Skip to content

placement: a unified card refusal names the host room - #944

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-hostroom-card-text
Oct 29, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-hostroom-card-text

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

통합 메모리 장치의 카드 여유 공간 거절문이 호스트 room과 BLOOMERY_HOST_ROOM 설정을 설명하고 그에 맞는 조치를 안내하도록 고치는 수정입니다.

What and why

On a device that shares the host's memory, the free bytes the planner checks are the host room. When a plan was refused because the dense trunk did not fit, the message said "the device had N B free" and advised "free the card". A user who had set BLOOMERY_HOST_ROOM was told to free a card that was never the limit.

The refusal for a unified device now says "the device's host room is N B" and names where that number comes from: BLOOMERY_HOST_ROOM when set, otherwise the host's memory reading. Its advice reads "raise or unset BLOOMERY_HOST_ROOM if set, or free host memory, or plan a placement on a card with room". A discrete GPU keeps the old text. The floor arithmetic, the budgets and the planner's choices are unchanged.

The planner now hands CardFreeFloor a unified flag taken from the node the card belongs to (the local stage, the local tier, or a tier on another node), and Display for CardFreeFloor picks the wording from it.

Release notes: Fixed: a card refusal on a unified-memory device names the host room and BLOOMERY_HOST_ROOM and advises raising or unsetting the lever or freeing host memory.

Code shape

  • No second copy. The refusal text is written in one place, CardFreeFloor's Display.
  • Model code holds only architecture facts. No model file is touched.
  • Dead code is gone. Nothing was made unused.
  • No silent failure. A trunk past the free bytes is still a named CardFreeFloor error.
  • Comments state what is true now.
  • No relaxed gate. No band, tolerance or lint moved.
  • cargo fmt --all -- --check is clean.

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

What I ran

Tested head 8366d3cf78f366ca1ddfa98ab8ed1b32c32c22be on upstream main fdc0ccad2f7d45b59f1f7b017f34df2660db6240, on a CPU-only Linux machine:

cargo fmt --all -- --check
cargo test -p bloomery-placement --lib placement::tests::legs::a_trunk_past_the_free_bytes_is_refused_by_name -- --exact --nocapture
  • The format check printed nothing and the command exited 0.
  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 217 filtered out; finished in 0.00s.

The test checks the discrete GPU text (no BLOOMERY_HOST_ROOM) and a unified device with the same shortfall (host room wording, the lever and the new advice, and no "free the card").

AI help

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

@github-actions github-actions Bot added the placement Placement planning: crates/placement label Oct 29, 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 flag reaches the one error site on every planner path, the node index is in range, and the refusal text changes only for a unified device.

Non-blocking

⚠ The tier branch has no test: planner.rs:302. The new test covers a stage card only. Mutant: change the tier index to 0 always, or to t. No assertion turns red, and a tier on another node with its own pool would get the wrong wording. Direction: add a case with tiers: vec![..], two nodes, nodes[1].unified = Some(..) and nodes[0].unified = None, and assert the host-room text for the tier's refusal.

Checked

  • Duplicates: 1 new field (unified), 0 new functions. Grep for another CardFreeFloor constructor or a second "free the card" text: none. workstation.rs:1275 words a different refusal (HostShort), not the same text. dryer: 0 pairs.
  • Complexity: CardFreeFloor::fmt 1 → 9 is two wording branches in one Display, even growth, harmless. plan_rule 40 → 41 is one field in a struct literal.
  • Silent failure: 3 sites followed. nodes[t + 1] is in range because plan_rule returns PlacementError::Nodes unless nodes == 1 or nodes == 1 + tiers (planner.rs:231). unified only picks wording. The error and its free and floor values are unchanged. ctx_ask.rs:166 reads only floor and free.
  • Tests: the stage-card unified case turns red if the flag is dropped to false or the two texts are swapped. The tier case is open (see above).
  • Gates: no pin moved. Hot path: none (refusal text only). Escape catalog: no match. Ledger: no lessons in force.

Notes

  • No GPU evidence in the PR body. The change touches only refusal text, so none is needed.

🔨 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 248ed06 into midagedev:main Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

placement Placement planning: crates/placement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant