Skip to content

fix(qwen): consume checked Card reserves after merged context policy - #372

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
Burntgogi:fix/card-dense-caller-followup
Oct 16, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
Burntgogi:fix/card-dense-caller-followup

Conversation

@Burntgogi

@Burntgogi Burntgogi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The concurrent merges of #339 and #359 leave current main e195c9e6af40372d56543c779f52222e3cf5955e uncompilable for both the Qwen CLI and shared server. Whole::dense_refusal still assigns the now-checked Card::reserve_bytes() -> Option<u64> directly to the u64 CardBudgetFloor.reserves field. Its existing typed-context regression also compares an unchecked expectation against the new optional result.

Decision

Complete those two caller migrations only. A bounded reserve preserves the typed CardBudgetFloor and all shortage fields. Overflow becomes CardBytesPastU64 naming the card, never a zero/default or a retryable shortage. The existing bounded test construction unwraps explicitly. Update the helper's rustdoc; do not duplicate the parent context test or change context policy, kernels or bands.

Source: 626be5fb686053de9e4bbcc262679c7d7351481f on merged current main. This is the small caller migration already present in the independently verified 62ea287 branch; #359 merged its earlier 5e3f139 head before that later branch update.

Verification scope

Fail-first: a fresh isolated all-feature metadata check for generate_qwen3moe and bloomery-serve on unmodified current main exits 101 with E0308 (expected u64, found Option<u64>) at both inclusions of qwen3moe_place.rs:660. This is a compiler/API repair, not an NVIDIA execution result.

The separate pre-existing split-prefill compile regression is fixed by #370; it is deliberately not mixed into this patch. Actual NVIDIA dense/context/serving acceptance remains unrun on this AMD-only host.

After the fix, exact-head formatting, both all-feature production-target metadata checks, workspace/all-targets metadata and all 138 placement tests pass. Actual-source host execution of the private dense-refusal owner preserves bounded reserves=3, budget=8, floor=9 and the named card in the typed shortage; [u64::MAX, 1] reserves produce the named CardBytesPastU64, not a retryable shortage.

Post-merge integration 09bd728f56a21a4fc708f3c638e2d3d8afc3ab1f, containing current main plus this repair, #370 and the separate dense diagnostics, passes full-feature GPU-test metadata and 124 default host-library tests (3 ignored). No CUDA execution is claimed.

Immutable fail-first diagnostics, exact-head verification log, actual-source host smoke and post-merge integration log.

@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 16, 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: The migration preserves typed shortages and reports reserve overflow by name.

Checked

Duplicates: 0 new items; searched reserve consumers and error owners. No duplicate introduced; no dryer pairs supplied.
Complexity: crapper flagged no functions; the added branch handles a named error.
Silent failure: 2 changed sites followed. Production overflow returns CardBytesPastU64; the bounded test expectation panics explicitly on overflow. Neither substitutes a default.
Tests: static mutation check of qwen3moe_place.rs:659: stringifying CardBudgetFloor makes the existing typed downcast fail. Restoring either unchecked API use fails type checking. No tests executed.
Gates: no pins, thresholds or cases removed or relaxed.
Escape catalog: C1–C4 do not match.
Adversarial checks: empty reserves sum to zero; overflow remains fatal through context selection; checked and unchecked load terms retain their existing assertions. This is a load-time error path.

Notes

Dryer did not run, per diagnostics.
The PR reports FAIL-first compilation but supplies no post-fix check output or NVIDIA gate run. This review did not execute builds or gates.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/qwen3moe_place.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
juliankang4 merged commit 686da9f into midagedev:main Oct 16, 2026
7 checks passed
@juliankang4

juliankang4 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

@Burntgogi Thanks for both fixes, and for the work it took to track these down. #370 and #372 are merged, so main builds bloomery-serve and the GPU gates again. Both breaks came from my PRs (#351 and #339), and the CPU check could not see them because it does not build the GPU targets.

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.

2 participants