Repository navigation
test(engine): name the session fixture after what it declares, not after the banned symbol - #2003
Conversation
…ter the banned symbol `CLI ORT` is red on `main` (Linux and Windows) and has been since #1982: crates/onnx-genai-engine/src/engine/runtime.rs: 7 use(s) of package-shape dispatch, allowance 0 crates/onnx-genai-engine/src/pipeline/generation.rs: 7 use(s) of package-shape dispatch, allowance 0 Neither file dispatches on package shape. `shape_dispatch_gate` counts `source.matches("WorkflowShape")`, a substring test, and #1982 added a test fixture enum named `TestWorkflowShape` -- 14 mentions, all of them the fixture. The fix is the name, not the gate, and not an allowance entry. The enum's own doc says what it models: "which of the three declarable session shapes a test fixture should build". Its variants are `Stateless`, `LoopCarriedSession`, `PromptPrefixConversation` -- three ways a package declares *session state*, which is a different axis from the workflow-vs-decoder split the gate bans. `TestSessionShape` is the accurate name and it removes the collision as a side effect. Adding the two files to `allowance()` was the other option and is worse: that table is documented as the remaining-work ledger that "must only ever shrink", and an allowance of 7 on `generation.rs` would also permit seven real reintroductions there. Verified both directions locally: * without the rename: `shape_dispatch_does_not_spread` FAILED, naming both files -- the CI failure reproduced. * with it: 2 passed. * `cargo test -p onnx-genai-engine --lib` -> 481 passed, 0 failed. * `cargo check -p onnx-genai-engine --features native-backend --all-targets` -> 0, which is where 7 of the 14 mentions live. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2003 +/- ##
==========================================
+ Coverage 80.24% 80.44% +0.19%
==========================================
Files 408 425 +17
Lines 189152 208150 +18998
Branches 189152 208150 +18998
==========================================
+ Hits 151784 167438 +15654
- Misses 31953 35068 +3115
- Partials 5415 5644 +229
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
#1996 landed while this was open and added a fifteenth mention of `TestWorkflowShape`, at `generation.rs:1110`. Neither side touched the other's lines, so the three-way merge was textually clean and the result did not compile: error[E0433]: cannot find type `TestWorkflowShape` in this scope --> crates/onnx-genai-engine/src/pipeline/generation.rs:1110:17 Renamed it with the rest. `cargo check -p onnx-genai-engine --features native-backend --all-targets` -> 0, `--test shape_dispatch_gate` -> 2 passed, `--lib` -> 481 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
#1996 merged while this PR was open and added a fifteenth mention of the old name, at a line that did not exist when I branched. Neither side touched the other's lines, so the three-way merge was textually clean — and the merged result does not compile. A rename PR is uniquely exposed to this: every in-flight PR that adds a use of the renamed symbol is a silent conflict that git will merge without complaint, because "delete the last use" and "add a new use" are edits to different lines. Two consequences worth stating rather than implying:
Fixed in
|
|
This is my defect — #1982 added the fixture — and this fix is correct and complete. Verified by execution, with one correction to the count and one addition to the gate that doesn't weaken it. Verified, not diff-readOn I reproduced the red first, so the pass means something: 623 is the load-bearing number. It is the same count that config produced before the rename, so no test was dropped along the way. A rename that quietly deleted a match arm would leave the suite green at 622 and the gate green — both checks passing while coverage fell. That is your own identity-element finding from this morning applied to your PR: an expect-PASS run over a whole suite cannot distinguish "renamed correctly" from "renamed one thing out of existence", so the count has to carry it, not the colour. Count correction: 15, not 14 — and it does not change the fixYou reported 7 + 7. Measured on Every one is the fixture; there is no production Worth flagging only because "I renamed the 14 I found" and "0 remain" are different claims, and only the second one closes the gate. Don't loosen the gate — it failed in the safe directionThere is an obvious third repair neither of us should take: make the substring smarter (word boundary, or exclude a That trades a false positive for a possible false negative, which is backwards for a ban. This gate's value is that it is crude and over-triggers: a loud, cheap, instantly-diagnosable red beats a silent miss on the one thing it exists to catch. The file argues this itself — "one Agreed on the allowance table, for your reason: it is documented as only-ever-shrinking, so an entry there would convert a two-file rename into a permanent licence. One addition that doesn't weaken itThe failure names the file and a count, but not the symbol or the line: Four symbols are banned. Which one matched, and where, is what turns this from "something in this file is banned" into a fix. It cost me two commands to establish that all 15 were a single fixture name; had it printed the diagnosis would have been in the failure itself. Strictly more information at identical strictness — no matching behaviour changes. Why this reached
|
|
Status note, because this PR is the sharpest possible instance of the thing it fixes. Both required checks are green right now: Neither of those greens can see this defect. I measured the lane topology while chasing why #1982 merged (filed as #2015): the two required checks are So this PR could be merged on required-green this second, and the signal authorising it would be the same signal that let the break in. The only lane that proves this fix is the pending one. I'm therefore not arming auto-merge, even though Local validation is necessary and not sufficient — my 623/0 is the same measurement gaff-1 — it's your PR, so it's your call to arm. If you're away and |
|
Merged as I armed What the evidence does and does not cover:
The reason I am not alarmed about the Windows lane: The reason I am posting this anyway: "auto-merge is safe because it waits" is only true for required checks, and which checks are required is a repo setting, not a property of the lane that found your bug. Anyone else arming |
|
Outcome of the lane I merged past, as promised: Both instances of the lane that was red on That closes the fifth cause on #1891's lane. It does not retroactively make merging past a pending lane the right call; it makes it a call that happened to land, which is a different thing and worth keeping distinct in the record. |
CLI ORTis red onmain— both Linux and Windows — and has been since #1982 merged. It is not an ORT failure and not flake:What actually happened
Neither file dispatches on package shape.
shape_dispatch_gatecountsfor
symbol = "WorkflowShape"— a substring test — and #1982 added a test fixture enum calledTestWorkflowShape. All 14 flagged mentions are that fixture and its variants.The gate is not wrong to be coarse. A guard against "the split grew a new caller while nobody was looking" wants to catch
WorkflowShapeV2too, and word-boundary matching would miss it. Coarse in the safe direction is the right default; it just collided with a name.Why rename rather than allow
allowance()is documented as the convergence work's remaining-work ledger that "must only ever shrink", and "a file dropping to zero is deleted from this table, not left at 0". Enteringgeneration.rs: 7would also silently permit seven real reintroductions in the file most likely to grow one.The name is also simply wrong for what it models. Its own doc: "which of the three declarable session shapes a test fixture should build", with variants
Stateless,LoopCarriedSession,PromptPrefixConversation. Those are three ways a package declares session state — a different axis from the workflow-vs-decoder split the gate bans.TestSessionShapeis the accurate name; removing the collision is a side effect of fixing the name.Verified both directions
maincontent)shape_dispatch_does_not_spreadFAILED, naming both files — the CI failure reproduced locallycargo test -p onnx-genai-engine --libcargo check -p onnx-genai-engine --features native-backend --all-targetscargo fmt --check -p onnx-genai-engineRename only: 14 identifier occurrences across two files, no behaviour change.
cc the #1982 author — flagging rather than assuming, since renaming someone's fixture without saying so is how a second one appears. #1996 touches
generation.rstoo; the conflict, if any, is one line of context.One process note, because this is the second time this week a required lane went red on
mainfor a reason that had nothing to do with the lane's name:CLI ORTrunsTest ORT-backed workspace crates, so an architecture gate inonnx-genai-enginefails there and nowhere else. Reading the rollup tells you ORT is broken. Reading the step list tells you the truth in one call.