fix(ENG-EXPERT-STREAM): the liveness line could not print the zero the docs told an operator to read, and then its comments outran the code twice (#912, #1091, #1106, #1108) - #1100
Merged
Conversation
…e docs told an operator to read (#912, #1091) The wiring repair that closed F1 shipped a statistics line so a dead lane could not look like a live one. It had one caller, `EndStep`, and it returned early on `steps == 0` — so the run where the step boundary is never reached, which is F1 itself, printed nothing at all. Measured on one binary with STATS_EVERY=1: healthy 8 lines, F1 reinjected 0 lines. `stats_every_` also defaults to 16, so a short healthy run prints nothing either, and a benchmark reading absence as failure calls a working lane VOID. That happened, and it is why the streaming benchmark had to be restarted. The final line now prints once from the store's own destructor, crossing both early returns, and the docs describe the banner/final-line pair instead of a zero that could not appear. `CHECK(s.advised > 0)` could not fail for the defect it named either: reinjecting the pre-fix unaligned `madvise` address exits 0 in 40 of 40 runs, because one slice in 48 happened to land page-aligned. The true healthy invariant on that arm is `advised == fills`, verified stable over 50 runs before being asserted rather than after. And "every MoE entry point funnels through here exactly once per forward" was false. Four more forwards reach the slice seam and marked no step, two of them the production spec-decode draft path, so a draft's slots stayed pinned across the following target forward. One forward is one step, including a draft, because a draft is a complete forward whose slices are finished with when it returns; folding it into the target's step would pin them twice for nothing. The opposite error is the one adding guards invites, so the guard now refuses to nest rather than silently ending a step that never happened. Three smaller repairs ride along, each of the same class — a claim nothing checked. `EnsureFile` is the arm every real GGUF-mmap checkpoint takes and no test reached it. `TowerUid`'s comment promised identity for a tensor's current bytes while the code keys on its address, which is the exact overclaim that caused #1066 on that same field. And the forced-fallback switch, which has no production caller, was inflating the operator-facing `exhausted` counter and so telling operators to raise a budget that was never the reason. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
…client it does not have (#1091) The header said each binary keeps its own environment setup "because that is exactly what differs between them", and named `test_expert_stream_mixed_slot` as the example. That binary does not include this header and cannot: its subject is a tower set whose gate/up and down slices differ in size, so its model is a different model rather than a copy of this one. Read as written the comment promised a shared model that is not shared, which is the same overclaiming shape the rest of this branch exists to remove. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
…true (#1091) Both pages said the final expert-stream statistics line is printed whatever the run did, and the table right beneath one of them lists a case where it is not: a process that never built a store prints no banner and no line, which is how an operator tells "the lane was never reached" from "the lane ran". The prose now carries that qualifier, and USAGE no longer attributes an absent line solely to a process that died. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
…C also builds (#1091) `scripts/build-windows-release.ps1` configures with `VLLM_CPP_BUILD_TESTS=ON`, so the native Windows lane compiles every test in the tree, and MSVC has no `<unistd.h>`. Both new files included it unconditionally even though only the statistics-line questions need POSIX: one redirects stderr across the flush, the other runs the binary again as a child, and the pread case needs `::fileno`. The step-clock cases need none of it and stay built everywhere, which is right — `EnsureSpan` and the step boundary work on Windows even though `EnsureFile` refuses there by name. The Windows lanes are red on `main` for their own reason (#584), which is exactly why this could have ridden in unnoticed: a lane that is already failing cannot report a new failure. Linux is unchanged — 160 and 882 assertions across 6 and 4 cases, the same counts as before the guards. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
The branch was behind `origin/main` at `22056e238`, so `agent-preflight.sh` SKIPPED its `commit-trailers` and `commit-style` range gates rather than running them, and a clean `git merge-tree` says nothing about whether the merged tree compiles. Merged here so both gates have a range to read and so the full suite runs on the tree that will actually land: 500 tests, 0 failed, rc 0. No conflicts. The incoming change touches NemotronH's device MoE, the NAS checkpoint root and the Music3 quant gate, none of which this branch edits. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
…ver built, and the nesting refusal was pinned nowhere (#1106, #1108, #1091) A fresh review of the #1091 repair returned FAIL. Its six functional repairs are correct and all thirteen of its mutation claims reproduce independently, so nothing here changes what the lane does. What failed is what was said about it, and three of the four findings are the class that pull request was fixing. The header claimed the final statistics line is reached by "a static registered the first time streaming is requested, plus the store's own destructor". There is no such static, and the same pull request says in its own body that the hook was deliberately not built. It also promised one line per process without either qualifier the docs carry. `~Qwen35ExpertStream` is now named as the only production caller, with both qualifiers, and with what the exposed seam costs a caller: it takes the once-flag, so calling it suppresses the teardown line. That is a fourth banner/final-line shape, and the docs table names it rather than leaving a gate's output looking like a crashed process. "Nothing lands dead" was claimed for four step guards and holds for one. Only `Qwen3_5MTPModel::ForwardPaged` has a production caller; the other three sit in parity-only entry points whose every caller is under `tests/`. No guard is deleted, because they are correct where they sit and because adding the guard later together with the caller is exactly how this row lost its step boundary in the first place. The record changes instead: they are named as a staged slice that lands unreached, here, in the pull request body and under the spec's `## Owed`, tracked as #1108. The nesting refusal was stated in the source, the spec and the pull request body, and deleting its `VT_CHECK` left both focused binaries fully green. No legitimate call graph can nest a step, because every forward that takes expert slices is a complete forward that no other one contains, so a gate cannot reach the refusal through production code and a gate that reimplemented the flag would prove its own copy. `detail::ExpertStreamStepScope` therefore forwards to the guard's own `Begin`/`End`, and the case asserts the refusal twice: a second scope throws, and a real `ForwardDense` entered while the scope is held throws too. The second is the load-bearing one — it is what shows the two share a boundary rather than agreeing by coincidence, and the mutation that gives the scope a parallel flag kills only that pair. That refusal stays UNGATED on `Qwen35ExpertStreamRequested()`, deliberately. One forward is one step is a property of the call graph, not of the streaming lane, so a nest is a defect whether or not a store exists. Arming it only under streaming would leave the rare configuration as the only place it can fire, and let the default path establish a nest nobody sees until someone switches streaming on, which is this row's recurring shape. The cost is that a forced nest reds every Qwen3.5 forward and not merely the streamed ones, and that breadth is the point. `::setenv` sat at namespace scope in both new gates with no `_WIN32` guard. It is POSIX, MSVC has only `_putenv_s`, both targets are added unconditionally, and the Windows release script builds the tests, so neither translation unit compiled there and the claim that the step-clock cases are built everywhere was false. Both now use the shim #603 landed for this. CI could not have reported it: the Windows lanes fail earlier, inside the product library, on #1068, and the static checker that could have is blind twice over — it reads only the shipped-server sources and knows neither `setenv` nor `unsetenv`. Measured OK, rc 0, on the unrepaired tree. Filed as #1107 against `ENG-RELEASE-WINDOWS` and not fixed here, because changing a checker's semantics needs its own spec and red-before evidence. `docs/FEATURES.md` carried the same overclaim in one line, promising "an `[expert-stream]` line at exit" flat. It now says IF a store existed, because a feature table that states a guarantee more strongly than the header does is the next place this defect reappears. That cell had one character of headroom under the 220-char keyed-table limit, so the qualifier costs "LFU + LRU tiebreak" from the same cell: an eviction policy is implementation, it is stated twice in the spec, and which guarantee the operator actually gets is not. Three mutations on the added guarantee, three caught, each with a changed sha256, a zero compile status and a non-zero doctest case count. The Windows repair is not mutation-proven and the spec's `## Owed` says so: no MSVC is reachable from this host. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
…this delta's own records refute, and an audit found seven more (#1106, #1108, #912) A fresh review of `4ada1fb8d` returned FAIL on one blocking finding: `qwen3_5.cpp` called "the MTP pair" the production spec-decode draft path five lines above the guard, and `test_expert_stream_steps.cpp` said the same, while the spec's `## Owed`, the #1108 index row and the pull request body all said one guard in four. The tree stated two contradictory things about one fact, and the false half sat where a reader hits it first. The reviewer's closing warning is what this change follows rather than the two line numbers: this is the fourth consecutive review in which the code was right and the sentence about it was not, and a targeted patch on two known lines is how the fifth one gets set up. So every claim in this row's delta about reachability, production paths and guarantees was audited against the code. 51 claims examined, 12 wrong, 12 repaired. Search terms: production, reached, "only caller", "no caller", every, always, exactly, guarantee, never, plus call-graph greps for ExpertMlpKq, KqExpertSlice, ForwardLayers, ForwardDense, ForwardPaged, ForwardLogitsHost, Qwen3_5ReplayLayer, ExpertStreamSetForceFallback, ExpertStreamFlushStats, FlushFinalStats, ExpertStreamStepScope, RunMoeBlock and ReportStats. The other 39 hold. Seven of the twelve were not cited by the review, and they are why the audit was worth more than the patch. `qwen3_5.cpp:5359` headed `FlushFinalStats` with "TEARDOWN IS THE REAL CALLER" while the destructor three lines below deliberately does not route through it. `qwen3_5.cpp:8176` explains a draft+target pair inside the MTP overload that never runs one. The spec repeated the false MTP claim at :1233 and conflated caller with path at :1291. The append-only issue index carried it too, in the #1091 row this pull request appends: corrected in its only open window, because that row does not exist at the merge base, so the diff carries no removal line and a union merge cannot duplicate it. The pull request body carried both. The three advisory findings are repaired as asked. `docs/FEATURES.md` promised the exit line under one of its two qualifiers; that cell measures 220 of 220 against MAX_CELL_CHARS, so the fix is a trade and the trade is stated: `(#1106)` is spent to buy "on a clean exit", a cross-reference the spec, both docs and `git log --grep` still carry, spent on the half of the guarantee an operator cannot recover from anywhere else. `docs/USAGE.md`'s fourth shape was keyed on an observable that does not discriminate, because `PrintStatsLine` makes the periodic and final lines byte-identical, so a run of 16 or more steps that then crashes matches it as well as row 3; it is now keyed on its cause, a call to `ExpertStreamFlushStats`, and says outright that stderr cannot separate the two. `qwen3_5_internal.h:422` now leads with the sharper true statement: that function has zero production callers and exists for the gate, while the only production path to the line is the destructor, which does not call it. `ForwardPaged`'s caller is itself unreachable unless a speculator is configured (`runner.cpp:2120`), and `.agents/reachability.md` speaks of the default configuration, so "has a production caller" is true where "reached on the default configuration" is not. That nuance belongs to #1108, which already owns the debt, but the qualifier is carried in the three sentences being rewritten here anyway, because leaving a knowingly imprecise clause standing immediately after an audit for imprecise clauses is the failure this change exists to stop. No behaviour changes, which is exactly why only a reader catches this class: the focused gate cannot regress on any of it. The evidence is the audit, plus an unchanged gate. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5-1m [claude-code]
GitHub reported this branch CONFLICTING while `git merge-tree --write-tree` reported it clean, rc 0. The disagreement is the `merge=union` driver on `.agents/issue-index.md`: GitHub does not apply the repository driver when it computes mergeability, so an append-only index that unions cleanly locally still reads as a conflict on the forge. Merging main in resolves it without a force-push, which would in any case destroy the merge base the reviewed head is anchored to. The merge commit carries its own trailer block because the trailer gate does not exempt merges. An earlier attempt at this merge spelled the tool without brackets and the attribution rule rejected it; `Assisted-by` requires the bracketed form. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
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.
Repairs the six findings of #1091, a fresh review of the #912 wiring repair that landed as
a332fb98d(#1076), and then the four findings of #1106, a fresh review of this pull request. RowENG-EXPERT-STREAM, specexpert-streaming.md. None of the ten findings was a red test. Every one was a gap in what the gate could see, which is the same class as the defect the first repair had just fixed — and #1106 finding 1 is that class reintroduced, one file away, by the change that fixes it.The liveness line could not print the zero the docs told an operator to read
ReportStatshad exactly one caller,EndStep, and it returned early onsteps == 0. So the run where the step boundary is never reached — F1, the defect the line exists to reveal — printed nothing at all. Measured on one binary withVT_MOE_EXPERT_STREAM_STATS_EVERY=1: healthy, 8 lines; F1 reinjected, 0 lines and only the startup banner.stats_every_also defaults to 16, so a short healthy run prints nothing either. A benchmark that reads absence as failure therefore calls a working lane VOID, which is what happened to the streaming benchmark and why it had to be restarted.One final line is now printed from the store's own destructor, once per process, crossing both early returns. Measured red-then-green on the same production binary:
Not a second teardown hook registered when streaming is REQUESTED, which was the first shape tried and would have covered the "asked for it, never built a store" run as well. On a CPU-only host that hook's only unique job is unreachable from any test, because
ReserveandGetsit in one call chain and a device platform is what separates them. It would have been an untestable branch added to fix an untestable-branch problem. What replaces it is a protocol the docs now state: the[expert-stream] ON ...banner means a store was built, the final line says what it did, and each present/absent combination means exactly one thing. The residual is recorded under the spec's## Owedwith its reason.docs/ENVIRONMENT.md:82anddocs/USAGE.md:3105both instructed the operator to readsteps == 0off the unreachable line; both now describe the final line and the banner pair.CHECK(s.advised > 0)could not fail for the defect it namedReinjecting the pre-fix unaligned
madviseaddress exits 0 in 40 of 40 runs. The measured reason is that> 0over 48 calls is satisfied whenever heap layout happens to page-align a single slice, and one did:advised=1againstfills=48.advised == fillsis the true healthy invariant on that arm — madvise is issued on the mapping-copy path only, and only when the key is not already resident, which is exactly the condition under whichEnsureSpangoes on to fill, withexhausted == 0asserted beside it as the premise. It was verified stable over 50 consecutive runs before being asserted rather than after.Two residuals it rests on are now stated beside it rather than left to be rediscovered:
madviserounds the range's END up past a heap allocation and would returnENOMEMon an unmapped trailing page, so the equality holds because the allocator's arena page is mapped and not because the arithmetic guarantees it; and the counters are cumulative, so the equality is a statement about everything that ran before it — the pread case at the end of the file fills without advising. That ordering is not implicit: theCHECK_FALSE(s0.active)opening the case fails loudly if anything ran first."Every MoE entry point funnels through here exactly once per forward" was false
Qwen3_5Model::ForwardDense,Qwen3_5MTPModel::Forward,Qwen3_5MTPModel::ForwardPagedandQwen3_5ReplayLayerall reachExpertMlpKq -> KqExpertSliceand marked no step. ONE of them,Qwen3_5MTPModel::ForwardPaged, is the production spec-decode DRAFT forward, so a draft's acquisitions stayedprotected_this_stepacross the following target forward — F1 at draft scale. This paragraph said "the MTP pair" through two revisions; the table further down is the measured version, and the last section of this body is the repair.One forward is one step, and that is the call the draft forced. A draft is a complete forward whose slices are finished with when it returns; folding it into the target's step would pin them across a second forward for no benefit, so a spec-decode iteration advances the clock once per draft plus once for the target. The opposite mistake is the one adding guards invites — a guard nested inside another ends the step twice, which decays every resident entry an extra tick for a step that never happened — so the guard REFUSES to nest, stated as a precondition in the same idiom
MatmulF32Sliceuses forexpert >= 0rather than handled.RunMoeBlockstays deliberately unguarded: it is one block, not a forward, andqwen3_moe.cppowns the boundary for the model that composes it. That exemption is what makes thesteps == 0case constructible without breaking anything.Three smaller repairs, all the same class
ExpertStreamer::EnsureFileis the arm every real GGUF-mmap checkpoint takes and no test reached it, so thefile_offset + offsetcomposition was unverified. A CPU-local case now drives it through the production seam from a temp file at a deliberately awkward offset (4109 bytes: past a page, not on a page, not on a 34-byte Q8_0 block), and it PROVES the arm rather than assuming it —advisedstays flat whilefillsgrows, which is the one number that separates a pread from anEnsureSpan. No box and no 370 GiB checkpoint needed.OwnedTensor::TowerUid's comment promised an identity for "this tensor's CURRENT bytes" while the code keys onbytes.data(). The comment now states where the guarantee stops, and a borrowed-buffer case pins both halves — same address with different contents keeps the uid, a different address does not — because #1066 was that same overclaim on that same field. The smaller correct change: the comment, not the code.SetForceFallbackhas no production caller and was incrementing the operator-facingexhausted_, so a gate asking for the unstreamed arm told an operator to raise a budget that was never the reason. Measured:exhausted=42from the switch alone. It has its own counter now, kept off the stderr line because in a production process it is always zero.Then the review of that repair (#1106) found three claims that outran the code
The six repairs above are correct, and a fresh reviewer reproduced all thirteen of their mutation claims independently. What failed is what was said about them.
The teardown comment named a hook that was never built.
qwen3_5_internal.hsaid the final line is reached at teardown by "a static registered the first time streaming is requested, plus the store's own destructor, whichever runs first". There is no such static —grep -rn 'atexit\|quick_exit'overqwen3_5.cppreturns nothing, and the section above says in this same body that the hook was deliberately not built. It also promised "exactly one line per process, even on a run with zero steps" without either qualifierdocs/USAGE.mdcarries. This is #1091 finding 5 — a comment promising more than the code — reintroduced one file away in the change that fixes it, which is the strongest argument on record that the class is a habit and not an accident.~Qwen35ExpertStreamis now named as the only production path to the LINE, with both qualifiers (a store must have been BUILT; the process must RUN its static destructors), and with what the exposed seam costs a caller: it takes the once-flag, so calling it suppresses the teardown line for the rest of the process. That is a fourth banner/final-line shape, anddocs/USAGE.mdnow tabulates it rather than leaving a gate's own output looking like a crashed process.docs/FEATURES.mdcarried the same overclaim in one line and now says IF a store existed."Nothing lands dead" was claimed for four step guards and holds for one. The claim in this body's previous revision — "every added path is reached from a production entry point at this commit" — was true of one guard in four:
Qwen3_5MTPModel::ForwardPagedrunner.cpp:2183->spec_decode/mtp/speculator.cpp:107,262Qwen3_5MTPModel::ForwardForwardLogitsHost, a "standalone parity convenience" (qwen3_5_mtp.h:135) with no caller outsidetests/Qwen3_5Model::ForwardDenseqwen3_5.h:234; callers aretest_op_parity.cpp:1107,test_runner.cpp:1278,test_qwen35_paged_forward.cpp:293,320,385,403Qwen3_5ReplayLayerqwen3_5.h:322; only callertest_op_parity.cpp:1050Per
.agents/reachability.md, a call site inside a test is not reach. No guard is deleted. They are correct where they sit, they cost nothing, and they become live the moment any of those entry points gains a production caller — and adding the guard later, together with the caller, is precisely how this row lost its step boundary in the first place. What changes is the record: the three are named as a staged slice that lands unreached, in the commit body, here, and under the spec's## Owed, tracked as #1108.The nesting refusal was asserted everywhere and pinned nowhere. The source, the spec and this body all stated that the guard refuses to nest. Deleting its
VT_CHECKleft both focused binaries fully green —test_expert_stream_steps6/6 rc 0,test_expert_stream_wiring4/4 rc 0 — and it appeared in none of the thirteen mutations. No legitimate call graph can nest a step, because every forward that takes expert slices is a complete forward that no other one contains, so a gate cannot reach the refusal through production code, and a gate that reimplemented the flag would prove its own copy.Qwen35ExpertStreamSteptherefore names itsBegin/End,detail::ExpertStreamStepScopeforwards to them, and the new case asserts the refusal twice: a second scope throws, AND a realForwardDenseentered while the scope is held throws too. The second is the load-bearing one — it is what shows the two share a boundary rather than agreeing by coincidence, and mutationMN3, which gives the scope a parallel flag, kills exactly that pair and nothing else.That refusal stays UNGATED on
Qwen35ExpertStreamRequested(), deliberately. "One forward is one step" is a property of the call graph, not of the streaming lane, so a nest is a defect whether or not a store exists. Arming it only under streaming — the rare configuration — would let the default path establish a nest that nobody sees until someone switches streaming on, which is this row's recurring shape. The cost is that a forced nest reds every Qwen3.5 forward and not merely the streamed ones, and that breadth is the point.The MSVC repair was incomplete.
::setenvsat at namespace scope in both new gates with no_WIN32guard, so the previous revision's claim that "only the two questions about the statistics line need POSIX" was false and so was the file comment saying the step-clock cases are "built everywhere".setenv(3)is POSIX, MSVC's CRT has only_putenv_s,tests/CMakeLists.txt:1087adds the target unconditionally andscripts/build-windows-release.ps1configuresVLLM_CPP_BUILD_TESTS=ON— neither translation unit compiled there. Both now usevllm_test::SetEnvfromtests/support/test_env.h, which is where that branch has lived since #603 and which a new env-flipping test is supposed to use; the oneoverwrite=0call keeps its semantics as an explicitgetenvtest, because the shim is deliberately two-argument.CI could not have reported it. The Windows lanes fail earlier, inside the product library, on the pre-existing #1068 (verified:
git diff origin/main...HEADonqwen3_5_weights.cppis empty), and a lane that never reaches a test TU cannot fail in one. The static checker that could have is blind twice over —scripts/check-windows-portability.pyreads only the sources reachable from the shipped SERVER target, so no test TU at all, and itsPOSIX_PATTERNSname neithersetenvnorunsetenv. MeasuredWindows portability contract OK, rc 0, on the unrepaired tree. Filed as #1107 againstENG-RELEASE-WINDOWSand NOT fixed here: changing a checker's semantics needs its own spec and red-before evidence, and widening the scan totests/has to separate a guarded POSIX call from an unguarded one across a large surface.And then the review of THAT repair: the code was right and the sentence about it was not, for the fourth time
A fresh scoped review of
4ada1fb8dreturned FAIL on one blocking finding and three advisory ones. It reproduced every mutation independently and ran a 500/500 gate, so nothing here changes behaviour. What it found is that two source comments asserted the reachability claim this same delta's records refute:qwen3_5.cppcalled "the MTP pair" the production spec-decode draft path five lines above the guard, andtest_expert_stream_steps.cppsaid the same, while the spec's## Owed, the#1108index row and this body's own table all said one guard in four. The tree stated two contradictory things about one fact, and the false half sat where a reader hits it first.Its closing warning is the instruction this round actually followed: "this is the fourth consecutive review in which the code was right and the sentence about it was not, and a targeted patch on two known lines is how the fifth one gets set up." So rather than patch the two cited lines, every claim in this row's delta about reachability, production paths and guarantees was audited against the code.
51 claims examined, 12 wrong, 12 repaired. Search terms:
production,reached/reaches,only caller,no caller,every,always,exactly,guarantee,never, plus call-graph greps for each named symbol (ExpertMlpKq,KqExpertSlice,ForwardLayers,ForwardDense,ForwardPaged,ForwardLogitsHost,Qwen3_5ReplayLayer,ExpertStreamSetForceFallback,ExpertStreamFlushStats,FlushFinalStats,ExpertStreamStepScope,RunMoeBlock,ReportStats). The other 39 hold, including every one the reviewer had already reproduced.Five of the twelve were cited by the review. Seven were not, and they are the reason the audit was worth doing rather than the patch:
qwen3_5.cpp:5359~Qwen35ExpertStreambelow" headingFlushFinalStatsFlushFinalStats— its own comment three lines below says so. Identical in shape to the advisory finding about the header, and it had gone unreportedqwen3_5.cpp:8176Qwen3_5MTPModel::Forward's guard: "a spec-decode iteration therefore advances the clock once per draft plus once for the target"ForwardPageddoes.agents/specs/expert-streaming.md:1233.agents/specs/expert-streaming.md:1291.agents/issue-index.md:310(#1091row)check-issue-index-append-only.pyre-run green against22056e238The three advisory findings are repaired as asked.
docs/FEATURES.mdpromised the exit line under one of its two qualifiers; the cell measured 220 of 220 againstMAX_CELL_CHARS, so the fix is a trade and the trade is stated:(#1106)is spent to buy "on a clean exit", which is worth more to an operator than a cross-reference the spec, both docs andgit log --grepalready carry. Back to exactly 220.docs/USAGE.md's fourth shape was keyed on an observable that does not discriminate —PrintStatsLinemakes the periodic and final lines byte-identical, so a run of ≥16 steps that then crashes matches it as well as row 3 — and is now keyed on its cause, a call toExpertStreamFlushStats, with a paragraph saying outright that stderr cannot separate the two.qwen3_5_internal.h:422now leads with the sharper true statement:ExpertStreamFlushStatshas ZERO production callers and exists for the gate, while the only production path to the LINE is the destructor, which does not call it.On the judgement call the review left open:
ForwardPaged's caller is itself "UNREACHABLE unless a speculator is configured" (runner.cpp:2120), and.agents/reachability.mddefines a production entry point as a server or command-line path on its default configuration. "Has a production caller" is true; "reached on the default configuration" would not be. That nuance is recorded on#1108, which already owns this debt — but the qualifier is also carried in the three sentences being rewritten here anyway, because leaving a knowingly imprecise clause standing immediately after an audit for imprecise clauses is the failure this round exists to stop. No guard changed, and no claim structure was re-litigated beyond that clause.Nothing executable changed, which is exactly why only a reader catches this class: the focused gate cannot regress on any of it. The evidence is the audit — the counts and greps above — plus an unchanged gate.
Evidence
Red first for every fix. Findings 1, 3 and 6 went red on the unmodified tree (0 statistics lines;
Steps() - before == 1failing0 == 1at all four entry points;off.exhausted == 0failing42 == 0). Finding 2's red is the reinjected F5 defect against the tightened assertion (1 == 48). Findings 4 and 5 are reachability, so their red is the mutation. The #1106 repairs are comments, records and one pinned guarantee, so the guarantee's red is its mutation and the rest have nothing executable to redden.16 mutations, 16 caught. Every row records a non-empty
git diff --stator a changed sha256, a compile status, and the doctest case count, because a mutation that does not build reads as a passing test and a filter matching nothing prints SUCCESS. Two first attempts were INVALID rather than passing and are recorded as such:M9did not build (-Werroron an unusedfile_offset), andM1/M2first reported the CHILD process's doctest summary, because a failing case dumps the child's output into the parent's log and the firsttest cases:match therefore belongs to the child. Every row below takes the LAST match.test_expert_stream_stepsfinalbypasses both early returnstest_expert_stream_stepstest_expert_stream_wiringForwardguardtest_expert_stream_stepsForwardPagedguardtest_expert_stream_stepsQwen3_5Model::ForwardDenseguardtest_expert_stream_stepsQwen3_5ReplayLayerguardtest_expert_stream_stepsForwardLayersguard itselftest_expert_stream_wiringfile_offsettest_expert_stream_wiringtest_expert_stream_wiringTowerUidstops re-stamping a moved buffertest_qwen36_weightsexhaustedtest_expert_stream_wiringtest_expert_stream_wiringVT_CHECKtest_expert_stream_steps9ca33ee207a5→52b389634b48Endnever clears the flagtest_expert_stream_steps9ca33ee207a5→f3f740d98573test_expert_stream_steps9ca33ee207a5→b0d983980f3bMN1reds all six assertions of the new case and reportsSteps() - beforeas 3 where 1 is correct, which is the double-count the guard exists to stop.MN3reds exactly two —forward_threwand its message — which is the pair that proves the scope and the production guard share a boundary; the "a second scope throws" half survives a parallel flag by construction, and that is why it is not asserted alone. Each mutation was restored from a byte copy (nevergit checkout --, which would have restored the index over uncommitted work) and the file's sha256 re-checked against the pre-mutation value before the next one ran.Not mutation-proven: the Windows repair. No MSVC is reachable from this host, the Windows CI lanes cannot report a test TU while #1068 stands, and the static checker that would have caught it is #1107. The spec's
## Owedsays so rather than leaving it to be assumed.Gate
Merged
origin/mainat22056e238first. The branch was behind it, soagent-preflight.shhad been SKIPPING itscommit-trailersandcommit-stylerange gates, and a conflict-freegit merge-treesays nothing about whether the merged tree compiles.cmake --build build -j 12 && ctest -j 6on the MERGED tree, CPU-only Release, 20 cores:500 rather than 498:
test_expert_stream_stepsis new here, andtest_nemotron_h_moe_devicearrived with the merge.scripts/agent-preflight.shreports All gates green, withdoc-checkpoint,issue-index append-only,commit-trailersandcommit-styleall RUN over22056e238..HEADrather than skipped.The claims-accuracy repair on top (
3ef9d023c) reruns the same gate from a fresh build tree, and it has to be UNCHANGED because nothing executable moved:scripts/agent-preflight.shAll gates green, rc 0, both--stagedand over the committed range. Two notes on instrument hygiene, since this round is entirely about claims that were not checked. The header edits invalidate dependents, so the firstcmake --buildwas followed by a second that recompiled 506 targets — runningctestafter the first alone would have measured stale objects; a third build reportsninja: no work to do, which is what says the tested binaries are the committed tree. Andissue-index append-onlypassing is not by itself evidence, because a vacuous range also prints OK: the range it actually examined is 5 added lines and 0 removal lines over22056e238..HEAD, which is why editing the#1091row this pull request appends cannot union-duplicate anything.windows-msvc-cpuandwindows-msvc-vulkanare red, as they are onmainand on every recent pull request:qwen3_5_weights.cppdoes not compile under MSVC since #1054, filed as #1068 and untouched here.Two
docs/FEATURES.mdtrades are recorded rather than hidden, because that cell sits against the 220-character keyed-table limit and every addition to it evicts something. The first cost "LFU + LRU tiebreak" to buy "IF a store existed": an eviction policy is implementation and is stated twice in the spec, while which guarantee an operator actually gets is not. The second cost(#1106)to buy "on a clean exit", the qualifier the first trade had left out — a cross-reference the spec,docs/ENVIRONMENT.md,docs/USAGE.mdandgit log --grepall still carry, spent on the half of the guarantee an operator cannot recover from anywhere else. The cell measures 220 of 220 both before and after.Not run: anything on
dgx.casa. A benchmark held the host mutex and every repair here is CPU-local. The decode re-measure on a live cache stays owed for that host, unchanged by this change.FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5-1m [claude-code]