Skip to content

qwen38 serve and qwen4exp MTP gates: the floor band and the deep plain walk rest on premises that hold - #1147

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-1143-premises
Nov 3, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-1143-premises

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

Qwen3.8 서빙 게이트의 하한 구간과 MTP 게이트의 plain 걷기가 입력 내용에 기대지 않도록 고친 PR입니다.

What and why

Two Qwen3.8 gates assumed things that do not hold on every card or input. In gate_qwen38_serve, the paged clause's band started at the one-slot floor at CTX. The saved-state reserve the floor counts follows the context, so the two-slot floor at one position fell under that edge and the band was empty. The band now starts at the one-slot floor at one position, so both edges use the same context and the band is what the second slot adds. In gate_qwen4exp_mtp, the (z) plain rounds needed a drafted pass keeping more than one row right before a plain pass of the same slot, and the fixed schedule left that to where the draft's acceptances fell. A new plain_passes reads the passes each window takes when run alone and appends the first one that keeps more than one row, followed by a plain pass.

Refs #1143

Release notes: internal: two gate clauses stop depending on card-specific floors and on where the draft's acceptances fall.

Code shape

The review reads these first. A box left unticked needs one line of why.

  • No second copy. Logic two models (or two call sites) share has one common owner; I lifted it there instead of
    copying it (AGENTS.md "Common code first", docs/rust-quality.md R14). Where I found an existing copy, I
    named it below.
  • Model code holds only architecture facts. A model's own files carry only what its architecture forces
    (tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
  • Dead code is gone. Nothing I made unused is left behind (functions, flags, gate clauses, docs).
  • No silent failure. Undefined input is a named error or panic, never a defined-looking output.
  • Comments state what is true now. No dates, issue numbers or how a bug was found (tools/check-comments.sh).
  • No relaxed gate. No band, tolerance or lint moved to make a check pass; a re-pin carries PIN(YYYY-MM-DD):
    and its reason.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

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

What I ran

Base e845a6a67a83ea677965f2c29045278898164e86, PR head 6eceeb66b63cac8a29a4697f317759474d97b23a.

Clippy ratchet on the head (cargo clippy --workspace --all-targets with the gate feature set):

chain-clippy: lint rc 0 (^warning: 0, the ratchet 0 in tools/lint-ratchet.txt)

Card:

$ nvidia-smi
| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: 13.2     |
|   0  NVIDIA GeForce RTX 5090        Off |   00000000:01:00.0  On |                  N/A |
|  0%   43C    P8             15W /  400W |      34MiB /  32607MiB |      0%      Default |

Model: Qwen3.8-Flash-Next-UD-Q4_K_XL-0000[1-4]-of-00004.gguf from unsloth/Qwen3.8-Flash-Next-GGUF at revision 766911a6b7369840a91dbcd95f9f997acaab6cd6, folder UD-Q4_K_XL. SHA-256 of shard 1: 4448186216b3af4cc558bbce2c3213f01608f8f8b2e5267a9767971dd3ec8082.

The paged clause, real tier, plain arm:

export BLOOMERY_TIER=real BLOOMERY_BOX_LOCAL=1
BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'export BLOOMERY_GATE_V41_LOAD=1 && . tools/ref/ref-paths.sh && \
  cargo oxide build --arch $(bash tools/arch.sh) -- -p bloomery-gpu-gates --features deepseek41,gemma-embedding2,hf --release --bin bloomery-serve-qwen38 --bin gate_qwen38_serve && \
  cargo oxide build --arch $(bash tools/arch.sh) -- -p bloomery-gpu-gates --features gpu --release --bin generate_qwen3moe && \
  D=$(mktemp -d target/q38-serve-gate.XXXXXX) && T="The capital of France is" && I=$REF_TOKENS && \
  bash tools/gpu-gate.sh generate_qwen3moe --place gate --tokens "$I" -n 16 > $D/gen.log && \
  bash tools/gpu-gate.sh gate_qwen38_serve --arm plain --gen $D/gen.log --prompt "$T" --ids "$I" --dir $D/plain'
paged: floors beside the card with the checkpoints: one slot at one position 10641443968 B (card share 0 B), two slots at one position 10975971584 B (card share 0 B); the server's room 10808707776 B
check paged_floor_band_is_between_the_slot_floors: PASS
check paged_floor_set_parallel_is_refused_by_the_floor: PASS
gate-gpu-qwen38-serve: PASS
gpu-gate.sh: gate_qwen38_serve ran 321 s (exit 0)

The one-slot floor at one position (10,641,443,968 B) is under the two-slot floor (10,975,971,584 B), so the band is non-empty. The failure #1143 reported was the two-slot floor under the one-slot floor at CTX.

Hardware (if the change is for a machine)

NVIDIA GeForce RTX 5090, driver 595.99.02, CUDA 13.2, 32607 MiB.

AI help

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

…n walk rest on premises that hold

The saved-state reserve the host floor counts now follows the context, so
the two-slot floor at one position no longer sits over the one-slot floor
at the gate's full context. The paged clause's band is now between the
one-slot and two-slot floors at one position, where a second slot is what
raises the floor.

(z) plain rounds needed a drafted pass that keeps more than one row right
before a plain pass, which the fixed passes left to where the draft's
acceptances fell. Each slot's passes now end with the drafted passes its
window run alone takes to its first acceptance, then a plain pass that
walks those rows.
@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 Nov 3, 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 changed gates preserve their assertions; no must-fix defect was found.

Non-blocking

⚠ MTP run evidence: crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs:6665.
The PR records only the serve plain arm. Add real- and fixture-tier just gate-gpu-qwen4exp-mtp output, the old schedule's failure, and the repaired (z) result at the reviewed commits. This establishes the multirow case before other changes rely on it.

Checked

Duplicates: 3 new items checked (Pass, DEEP_TRIES, plain_passes); none duplicated. No dryer pairs were available.
Complexity: slots_windows 60 → 61; added schedule iteration, with no new decision policy.
Silent failure: 3 sites followed. No acceptance produces no tail; the real-tier deep > 0 assertion still fails when no multirow walk ran. Missing tail entries intentionally omit that slot.
Tests: static mutation audit only. Dropping the floor refusal at crates/placement/src/placement/room.rs:764 makes floor discovery error. Truncating gathered tokens at crates/app/src/mtp.rs:686 to one row makes the real-tier draft-store comparison fail.
Gates: one floor-band edge moved with PIN(2026-11-03), reason and card output. All 12 fixed MTP passes and the deep-walk assertion remain.
Adversarial: inactive-pass compaction and all bounded tail alignments preserve per-slot order; the supplied prompts leave context room for the probes. No engine hot path changed.
Escape catalog: no C1–C4 match.

Notes

Dryer did not run: diagnostics says no changed Rust file is under crates/, although both changed files are there.
GPU gates were not run here. The recorded run hashes differ from the supplied base/head, and no MTP run output is present.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen38_serve.rs, 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 c7f21a7 into midagedev:main Nov 3, 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