Skip to content

start: a host-side placement refusal names the bytes it asked for in the plan's refusal line - #1081

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-use-host-refusal-need
Nov 1, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-use-host-refusal-need

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

host 쪽 배치 거부가 --plan --json 거부 줄의 need에 요청한 byte 수를 내도록 고쳤습니다.

What and why

A host-side placement refusal (HostRoomFloor, NvTierArena, NvTierArenaUnder, DraftHostRoom, and a load's HostShort) printed "code":"no-fit" with "need":null in the bloomery.plan/1 refusal line, although the refusal knows the bytes it asked for. start::named_by read need only from card_short(), which is None for every host-side refusal, and from pool_short() for HostShort, which is None on a host whose cards have their own memory.

need now comes from the same two readers placement_code already uses to class the refusal (card_short(), then host_floor_short()), and a HostShort gives its host need. The class and the exit status are unchanged. Every family reaches this one owner through PlacementError::source(), so no model-specific branch is added.

Release notes: Fixed: a host-side placement refusal now reports the bytes it asked for in need of the --plan --json refusal line instead of null.

Code shape

  • 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. The change reuses PlacementError::host_floor_short and HostNeed::bytes in crates/gpu-gates/src/start.rs.

What I ran

Tests of the changed start:: module on a GB10 node, cargo oxide test --arch sm_121a -- -p bloomery-gpu-gates --lib start:: with the two production lines of named_by put back to base, then on this head:

test start::agent::tests::a_reserve_named_refusal_keeps_its_class_and_cause ... FAILED
test start::agent::tests::a_host_refusal_names_the_bytes_it_asked ... FAILED
test start::agent::tests::a_family_placement_refusal_keeps_its_class_and_need ... FAILED
test result: FAILED. 8 passed; 3 failed; 0 ignored; 0 measured; 309 filtered out; finished in 0.00s
BASE_TEST_RC=101
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 309 filtered out; finished in 0.00s
HEAD_TEST_RC=0

Real binary, BLOOMERY_HOST_ROOM=4G ./target/release/bloomery-serve --plan --json on the GLM fixture (glm53-fixture-00001-of-00003.gguf, three shards). On head the refusal line carries the NVMe expert tier's floor:

{"schema":"bloomery.plan/1","refused":{"code":"no-fit","message":"the host room 4294967296 B is under the NVMe expert tier's floor 9283837544 B ...","need":9283837544}}
SERVE_RC=80

The class (no-fit) and the exit status (80) are unchanged.

AI help

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

@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 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: The shared classifier reports host refusal byte counts while preserving refusal classes and card handling.

Checked

Duplicates: 1 new test function and 1 renamed test checked by Grep; no duplicate owner. The tests cover distinct refusal variants and wrapper paths.
Complexity: crapper flagged no functions. named_by adds a lazy fallback to an existing reader.
Silent failure: 2 changed extraction sites followed through classify, exit_serve and refusal_json; host shortages now carry their requested bytes to the JSON consumer.
Tests: Removing the fallback at start.rs:347 makes the reserve, family and arena assertions fail. Restoring pool_short() at start.rs:364 makes the discrete-host assertion fail. These are static mutation checks; the PR supplies FAIL-first output and reports 11 passing tests on head.
Gates: No gate, threshold, lint or test case removed or relaxed.
Adversarial checks: Wrapped host errors reach their source; unified-memory host errors retain the same byte calculation; card errors keep precedence; unrelated placement errors retain an absent byte count. No reachable regression found.
Performance: Startup refusal reporting only; no decode, prefill or kernel work changed.
Escape catalog: No C1–C4 pattern matched.

Notes

dryer did not run. Its stated reason contradicts the changed-file list, so duplicate checks used manual Grep.
Tests were not rerun. GPU evidence is incomplete: the PR supplies no nvidia-smi card/driver line, tested commit hashes or just gate-* output.

Card check: needs-gpu. This pull request changes 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 16ed80f 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 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