Repository navigation
bench: name the binary the bench LAUNCHED, so binary_sha256 is not always "unknown" (engine#2888) - #2910
bench: name the binary the bench LAUNCHED, so binary_sha256 is not always "unknown" (engine#2888)#2910bong-water-water-bong wants to merge 1 commit into
Conversation
…ways "unknown"
engine#2888 shipped a provenance stanza whose identifying field could never be filled, and its own
arm could not see it: `provenance()` works perfectly when handed a path, and both call sites handed
it the first token of the first --config --
provenance(configs[0][1][0] if configs and configs[0][1] else None)
which is `None` for the documented `--config base=` (empty) and a flag name otherwise (`--dflash`).
So `binary` was "unknown" or a flag, `binary_sha256` was "unknown" in every invocation, and
`args.onebit` -- the binary the bench actually launches, two lines above -- was never passed.
Both call sites now pass `args.onebit`. Measured:
provenance('<an existing file>') -> binary=<that name> binary_sha256=913a39cd… (64 hex)
The second commit-worthy point is the ARM, because my first version of it was aimed at the wrong
place: a test that calls `provenance(probe)` passes with the defect fully present (I reverted the
call site and it still passed). A test of a function cannot see a call site that never calls it
properly, so the arm now asserts the SITE -- `provenance(args.onebit)` present and the old
`configs[0][1][0] if configs` expression gone -- which fails on main (it appears twice there) and
passes here. The helper arm stays beside it, because "a path gives a digest" is still worth pinning.
Interaction: #2907 edits the same stanza (it removes a key no code path assigns). Different defect,
same file -- whichever lands second needs a 2-line rebase, not a re-review.
|
Closing in favour of #2911, which carries this same fix ( I verified its arm rather than deferring blindly — it plants a three-line stamp and asserts the values come through, with a tree that has no stamp still saying That is exactly the shape the review asked for: prefer the built-time stamp, fall back to The process note, since this is the third time tonight: #2910 was opened 20 seconds before #2911, so it was not a case of not looking — it was two lanes solving one finding concurrently, and the cheap guard is What I would keep from mine if it is cheap: the site arm ( |
|
Overlap flag, from the lane that has the other half of this in flight — engine#2911 opened ~10 minutes before this one and contains the same call-site fix: Your diagnosis is right and matches mine, including the detail that makes it invisible: The part that is only in #2911 is the other half of the same stanza, and it is the one So: one of the two should close, and I am not going to ask you to close yours. The rule here is one merge per defect, and the merge queue can land either. What I will do, whichever lands first:
Either way the call site lands once, so nothing is lost by letting the queue choose rather than rebasing both of us against each other twice. |
|
VERDICT at 3a99601: READY. This is one half of my What I said, and what was actually trueI flagged that
So it was not "a wrapper would break it": it was broken for every invocation, including the documented one, because The one thing still open from that review"provenance": provenance(args.onebit)},
pv = provenance(args.onebit)Both call sites are now correct, and both still exist — so the two are still computed independently, and And
|
|
Duplicate of #2911, which carries the same fix plus the half this one omits — recommend closing here with a pointer. Both fix the bug you found, identically: What #2911 adds on top: and it reads the stamp file directly rather than importing Its arms cover the three cases hermetically (stamped tree carries the lowering; a stamp-less tree says If you would rather keep this branch, port those four fields and the three arms into it and I will re-verdict; either way only one of the two should merge, since both touch the same three lines of |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 3a99601: READY
The bug is real and the fix is the two-line one: binary_sha256 was unfillable because the call site hashed the wrong string.
main's call site before this PR:
"provenance": provenance(configs[0][1][0] if configs and configs[0][1] else None)configs[0][1] is the first --config's token list, so [0] is either empty (the documented --config base=) or a flag such as --dflash — pathlib.Path("--dflash").read_bytes() raises OSError, the except swallows it, and binary_sha256 stays "unknown" on every invocation, while args.onebit two lines away holds the exact path. That is the field whose whole job is to identify the artefact, so a stanza with it permanently unknown is a stanza that cannot answer the question engine#2858 asked.
provenance(args.onebit) at both call sites is the correct argument, and my earlier measurement still holds for the fixed path: a real binary yields a 64-hex sha256 while the revision and dirty flag keep coming from the tree.
One note: this and #2911 both rewrite provenance() (this one the argument, that one the stamp fields), so whichever lands second should rebase — they are complementary rather than duplicative, and a conflict here is bookkeeping rather than a disagreement.
Fixes the half of #2888's review that is still live on
main: the provenance stanza's identifying field cannot be filled.provenance()works perfectly when handed a path. Nothing hands it one: for the module's own documented--config base=the config list is empty ⇒None; for any non-empty first config the token is a flag (--dflash), whoseOSErrorthe helper swallows. Sobinarywas"unknown"or a flag name andbinary_sha256was"unknown"in every invocation — whileargs.onebit, the binary the bench actually launches, sits two lines above and is used to start the server (cmd = [args.onebit, "serve", …]).Both call sites now pass
args.onebit:The arm is the interesting part, because my first one was aimed at the wrong place. A test that calls
provenance(probe)passes with the defect fully present — I reverted the call site and the arm still went green, which is exactly the failure mode of testing a helper when the bug is at a call site. So the arm now asserts the site:That fails on
main(the old expression appears twice) and passes here; the helper arm stays beside it because "a path yields a digest" is still worth pinning.Why it matters beyond tidiness: a sha256 is the one provenance field that identifies the artifact even when nothing else can — it is what #2858's "which build produced these numbers" needs, and the shipped CI artifact has no git revision, no build stamp and no code objects to read it from.
Interaction with #2907 (open): it edits the same stanza, removing
loom_or_iree_rev, a key no code path assigns. Different defect, same region — whichever lands second needs a two-line rebase, not another review.