Skip to content

gpu-gates: the MTP gate's store-behind cuts keep the point they cut to - #776

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-fix-mtp-fixture-rollback-at
Oct 24, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-fix-mtp-fixture-rollback-at

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

MTP gate의 두 절(store behind, off slot)이 2-slot checkpoint ledger 때문에 main에서 실패하던 것을, 두 번째 호출이 checkpoint를 찍지 않게 고쳐 통과시킵니다.

What and why

Two clauses of gate_qwen4exp_mtp do not get through on main, the store-behind clause and the off-slot clause. Both take a point at the end of a call that runs without the draft, run one more such call, then cut back to the first call's end. The cut should run and forget the draft's store, because the store does not reach that point.

The cut never runs. On the fixture the checkpoint ledger holds two slots, and a full ledger keeps the first point it took and evicts the later ones first (Ledger::take in crates/runtime/src/seqstate.rs, pinned by message_boundaries_keep_the_first_prefix_with_two_slots). The second call's point therefore evicted the point the cut needs, and the cut was refused before the draft's store condition was ever checked. The runtime keeps that order by contract, so the gate's second call must not take a point of its own.

The change is in crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs only:

  • store_behind turns checkpoints off before its second call, so the ledger holds the first point and the cut runs. The set_checkpoints(false) call that followed the cut moved up to sit before that second call.
  • off_slot turns marks off for its second call and back on afterwards, so the continuing call after the cut still runs with checkpoints on.
  • Both doc comments say why the second call takes no point.

The checks themselves are unchanged: the cut must succeed, the model must stand at the point, and the draft's store must read 0 there. No clause, band or tolerance was removed or relaxed.

Release notes: internal: the MTP gate's store-behind and off-slot clauses cut back to a point the ledger still holds, so they check the draft's store condition again.

Code shape

  • No second copy. No function, type or helper was added. set_marks and set_checkpoints are reused.
  • Model code holds only architecture facts. The change is in one gate binary. No common owner gained a branch.
  • Dead code is gone. Nothing was made unused.
  • No silent failure. The new calls propagate their errors with ?, and the cut.is_ok() check stays.
  • Comments state what is true now. The two doc comments describe why the second call runs without a point.
  • No relaxed gate. No band, tolerance or clause moved. The clauses fail where the store condition is removed (see below).
  • cargo fmt is clean on the changed file (rustfmt --edition 2024 --check printed nothing). cargo clippy was not run on this head here.

Duplication found or removed (path:line): none.

What I ran

Hardware: one RTX 5090 machine (x86_64 Linux), host mode, fixture tier.

NVIDIA GeForce RTX 5090, 595.99.02
| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: 13.2     |

The gate, on main and on this head:

BLOOMERY_TIER=fixture BLOOMERY_BOX_LOCAL=1 just gate-gpu-qwen4exp-mtp

Summary lines, main then this head:

GATE-RC qwen4exp-mtp=1
cut back to 85 (ran): the draft's store holds 0 at 85 PASS
clauses: 28 ran, 4 left to the real tier
GATE-RC qwen4exp-mtp=0
  • On main the gate stops: the store-behind clause reports cut back to 85 (refused: ... the checkpoint at 85 was evicted by the host budget) and FAIL, and the off-slot clause stops the gate with the checkpoint at 41 was evicted by the host budget. The exit code is GATE-RC qwen4exp-mtp=1.
  • On this head the store-behind clause reports cut back to 85 (ran): the draft's store holds 0 at 85 PASS, the off-slot clause reports slot 0's store 0 after its cut and PASS, and the gate ends with clauses: 28 ran, 4 left to the real tier and GATE-RC qwen4exp-mtp=0.
  • To check that the two clauses still guard the store condition, I ran the gate once more with the rejoin in rejoin_row (crates/gpu/src/arch/qwen3moe/body38.rs) changed to ignore the draft's held count, then restored the file. Both clauses fail: the draft's store holds 69 at 85 FAIL and slot 0's store 33 after its cut, with MUTANT-RC rejoin-without-store-condition 1. On main this change cannot be told apart from the unmodified code, because the cut is refused first.

I added no host test. The two-slot eviction order is already pinned by message_boundaries_keep_the_first_prefix_with_two_slots, and another test of it would repeat it. The change reorders gate calls only, so it adds no kernel, launch or copy and has no speed measurement.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

The store-behind clause and the off slot clause take a point at the end
of a call without the draft, run one more such call, then cut back to the
first call's end. Since 35813e4 a full two-slot ledger keeps its first
point, so the second call's point evicted the one the cut needs and the
cut was refused before the draft's store condition was reached. The
second call now runs without checkpoints, so the cut runs and the clauses
check that the draft is forgotten where its store does not reach the point.
@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: Both clauses preserve the rollback checkpoint and retain their draft-store checks.

Checked

Duplicates: 0 new functions, types or constants; existing setters reused; no dryer pairs supplied.

Complexity: Diagnostics report off_slot rising from 14 to 16 through two fallible setter calls in the existing sequence.

Silent failure: The 3 moved or added fallible calls propagate errors with ?. A refused rollback fails the gate.

Tests: Both clauses retain their held == 0 checks. The PR reports both failing when the store-count guard at crates/gpu/src/arch/qwen3moe/body38.rs:2843 is removed. Gate runs were not repeated during validation.

Gates: No band, tolerance, assertion or clause removed or relaxed; no pin moved. Disabling marks preserves existing points. off_slot restores marks before rollback. Reset clears saved points without changing the checkpoint setting.

Performance: Gate orchestration only; no production decode, prefill or kernel change.

Escape catalog: No C1–C4 pattern matched.

Notes

dryer did not run; duplicate checks were manual.

Add both tested commit hashes and the fixture model path to the reported RTX 5090 gate results. GPU evidence remains incomplete under CONTRIBUTING.md.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 6c15ff0 into midagedev:main Oct 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant