Repository navigation
fix(intrinsics): pin the probe toolchain by rustc commit, not llc bytes - #1227
Merged
Merged
Conversation
The evidence probe refused to run unless the rust-toolchain `llc` hashed to the SHA-256 recorded in the catalog. That hash names the wrong thing: `llc` is a 281 KB driver, the NVPTX lowering lives in libLLVM.so, and the bytes change whenever the loader path or RPATH does. nixpkgs rewrites both, so every `nix develop` shell failed `just check`; rustup on aarch64 fails the same way. The compiler was identical in every case. The identity the probe needs is the compiler source, which the rustc commit-hash names on every platform and which tells nightlies apart where the `LLVM version` line alone does not. The probe now compares the `llc --version` line per catalog record plus the `rustc -vV` commit-hash against a new required `[rust_toolchain] commit_hash` in intrinsics/upstream.lock. The lock is the one place that already pins what the evidence was built from, and rust-toolchain.toml pins one channel for the whole repository, so the commit is a repository-level fact rather than a per-evidence field; catalog.json and the evidence files are unchanged. Preserved: `backend_sha256` is still recorded and printed as provenance on every probe line, now next to the rustc commit; `--llc PATH` comparison probes stay unchecked; the emitted PTX still has to match the catalog's expected instruction on every probe. A lock without the table, or with a commit that is not 40 lowercase hex digits, fails at load. Verified with `probe --all --skip-terminal --per-target` under rustup nightly-2026-08-28 (llc 2e5bc688...) and under `nix develop` (llc ca7af83e..., same commit e457a7b0d): both probe 2374 target configurations across all 1025 routes. A wrong lock commit and a missing table both fail before the first probe. aarch64 was not run. Closes NVIDIA#1211 Signed-off-by: Sam, Joochul Chang <[email protected]>
Collaborator
|
Reviewed and validated:
Merging. |
nihalpasham
approved these changes
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1211
Summary
Validate the selected
llcby version plus therustc -vVcommit instead of its file hash. Keep SHA-256 as provenance. Explicit--llccomparison probes remain unchecked.Chose
upstream.lockbecause one pinned Rust toolchain probes all records, and the lock's[llvm] provenanceline already named this commit in prose. A per-evidence field would duplicate the commit 1025 times, back-fill existing evidence from that prose line, and churn evidence,catalog.json, and generated stamps.The commit check sits in
validate_backend_identitynext to the version check, as the issue comment specified, so the listed tests exercise one function; the same expected commit is passed for every record.Changes
[rust_toolchain] commit_hash = "e457a7b0d326d67b4322ef0d11bd715cfaeda48f".rustc -vVcommits as exactly 40 lowercase hex characters.Justfile, workflow, and bookupstream.lockrow.Testing
Before, origin/main
596a6353dfailed under Nix:After, the first selected-backend lines show the same source identity with different provenance bytes:
The full gate passed under rustup and
nix develop:Negative controls rejected a zeroed commit and a missing table. An explicit
--llcstill passed with the zeroed lock in comparison mode.Tests cover different bytes with the same identity, commit and version mismatches, comparison mode, missing and malformed lock metadata,
parse_rustc_verbose, and preflight intrinsic context.The catalog and evidence files did not change, so the catalog stamp script was not needed. aarch64 was not tested because no machine was available.
just checkpasses, run as one command insidenix develop(the shell the issue is about): exit 0 in 4m26s, all recipes includingcheck-intrinsicsanddoc-checkcargo oxide run <example>passes — not applicable to this host-side generator changeChecklist
git commit -s)