Skip to content

model, placement, start: a family's placement refusal is its error's source, so the start keeps its no-fit class - #1077

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-glm-nofit-class
Nov 1, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-glm-nofit-class

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

GLM을 포함한 모델 family의 배치 거절이 시작 단계에서 no-fit 종료 클래스를 잃던 문제를 고쳤습니다.

What and why

When a model family refuses placement, bloomery-serve should end with the no-fit class and exit code 80. A GLM seat whose host room is under the NVMe expert tier floor ended as an unnamed refused with exit code 1 instead.

Fixes #1071. start::classify finds the class by walking source() until a link downcasts to PlacementError. Every family wrapper of PlacementError used #[error(transparent)], which forwards source() to the inner error, so the PlacementError link never appeared in the chain. The wrappers now use #[error("{0}")] with #[from] (or #[source]), which keeps the display text and makes PlacementError the source. That covers all 12 wrappers, not only GLM's, so the start needs no per-family branch. print_refusal skips a caused by: line equal to the line above it, so the refusal that is now visible as a source prints once.

Release notes: Fixed: a model family's placement refusal, such as a host room under the NVMe expert tier floor, now ends bloomery-serve with the no-fit class and exit code 80.

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

On a DGX Spark (GB10), GLM fixture (glm53-fixture-00001-of-00003.gguf and its two shards).

Before: a_family_placement_refusal_keeps_its_class boxes HostRoomFloor in each start-path family wrapper and checks the class. On main (28bc0af4) with only this test added:

BLOOMERY_TIER=fixture BLOOMERY_MODEL=glm5next ./tools/box.sh 'cargo oxide test --arch sm_121a -- -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpoint --release --lib a_family_placement_refusal_keeps_its_class'
test start::agent::tests::a_family_placement_refusal_keeps_its_class ... FAILED
assertion `left == right` failed: Placement(HostRoomFloor { room: 1, floor: 2, base: 0, layer: 0, need: 2, arena: None })
  left: None
 right: Some(NoFit)
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 317 filtered out

After, at the head 9912c997f (base f9131fee2):

cargo oxide test --arch sm_121a -- -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpoint --release --lib start::
test start::agent::tests::a_family_placement_refusal_keeps_its_class ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 308 filtered out

The real binary on the GLM fixture, with a host room under the NVMe tier floor:

cargo oxide build --arch sm_121a -- -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpoint --release --bin bloomery-serve
BLOOMERY_HOST_ROOM=4G ./target/release/bloomery-serve --plan --json
bloomery-serve: the host room 4294967296 B is under the NVMe expert tier's floor 9283837544 B (...)
{"schema":"bloomery.plan/1","refused":{"code":"no-fit","message":"the host room 4294967296 B is under the NVMe expert tier's floor 9283837544 B ...
{"schema":"bloomery.event/1","event":"error","exit":80,"code":"no-fit",...
SERVE_RC=80

The refusal prints once, with no repeated caused by: line. Host rooms of 4G, 4500M, 5G, 5500M, 6G, 7G and 8G all refuse with no-fit and exit code 80. Rooms of 10G, 12G, 16G and 24G plan and exit 0.

AI help

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

@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement labels Nov 1, 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: All 12 placement-error wrappers expose the refusal to startup classification and preserve its display text.

Checked

Duplicates: 2 new test functions checked by Grep; they cover disjoint wrappers. Dryer returned 0 pairs; gpu-gates was checked manually.
Complexity: crapper flagged no functions. print_refusal adds one comparison for repeated text.
Silent failure: 1 output-suppression site followed; equal messages are skipped, while source traversal and failure status remain intact.
Tests: a_family_placement_refusal_is_its_errors_source protects crates/model/src/arch/glm5next/place.rs:428 and four other wrappers; restoring transparent fails its source assertion. a_family_placement_refusal_keeps_its_class protects crates/model/src/arch/hybrid.rs:480 and four other wrappers; the same mutant fails its NoFit assertion. These are static mutation checks.
Gates: no existing tests, bands, thresholds or pins moved. The PR supplies a FAIL-first classification test.
Adversarial: traced low host room through nested errors, pooled-memory refusals, non-capacity errors and repeated display text; no reachable regression found.
Performance: startup and error paths only; no decode, prefill or kernel work changed.
Escape catalog: no patterns matched.

Notes

Tests were not executed during this source review. The PR reports tests and a CLI run on GB10, but lacks the required nvidia-smi line and just gate-* output for GPU evidence.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/routed_legs.rs, crates/gpu-gates/src/lib.rs, crates/gpu-gates/src/start.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 bc4696d into midagedev:main Nov 1, 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 model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

start: GLM placement refusals lose the no-fit exit class

1 participant