Skip to content

gpu-gates: one helper makes a name a record token - #98

Closed
avlp12 wants to merge 0 commit into
midagedev:mainfrom
avlp12:gpu-gates-name-token
Closed

avlp12 wants to merge 0 commit into
midagedev:mainfrom
avlp12:gpu-gates-name-token

Conversation

@avlp12

@avlp12 avlp12 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Requested by Alis

What and why

The rule that makes a name one token of a key=value line or a file name (each space becomes _) was spelled .replace(' ', "_") at twelve sites on current main, more than the issue's seven:

  • eleven carry a card's device name: generate.rs, vision_seat.rs (four, two of them in tests), gate_qwen3_serve, oxart_jit, gate_glm5next_twocard, gate_ds41_serve (two) and gate_serve_start;
  • gate_deepseek41_rope applies it to a tensor-row name, which the issue lists too.

record::name_token(name: &str) -> String is now the one owner, and every site calls it. The rule is the same, so the strings the callers print and compare are unchanged. I named it name_token rather than card_token because of the rope site.

Closes #11.

Code shape

  • No second copy. This replaces all twelve with calls to the helper; rg "replace\(' ', \"_\"\)" crates now finds only the helper's body.
  • Model code holds only architecture facts. No model code touched.
  • Dead code is gone.
  • No silent failure.
  • Comments state what is true now.
  • No relaxed gate.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line): the twelve sites above. Two look-alikes were left alone as different rules: crates/placement/src/placement/devices.rs:164 (any whitespace) and crates/refset/src/ik.rs:91 (also / and \).

What I ran

On a Mac with the pinned toolchain (rustc 1.100.0-nightly (e457a7b0d 2026-08-27)) and the static tier's environment file, on this branch (one commit on main at f382b474):

$ just mac-check
mac-check: check rc 0
mac-check: combos rc 0; 41 shapes run, 0 red
$ just mac-lint
mac-check: lint ^warning: 41 = the ratchet 41 in tools/lint-ratchet.txt

cargo fmt --all --check and bash tools/check-comments.sh are clean at this commit too. The box gates and ptx-scan are yours, as the issue's row says. A record unit test pins the rule (NVIDIA RTX A6000 → NVIDIA_RTX_A6000); bloomery-gpu-gates tests build for Linux only, so it did not run here.

Earlier, on 1cba9707, just mac-static passed fmt-check, lint and combos; its check-recipes step was red on this Mac, and it was red on that base commit too, from the same narrow-scan and q38-3090-server self-tests. I did not rerun check-recipes at f382b474.

Hardware (if the change is for a machine)

Not hardware-specific. Mac Studio, Apple M3 Ultra, 512 GB, macOS 26.

🤖 Generated with Claude Code

@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 extraction preserves all twelve callers' name conversion and error handling.

Non-blocking

⚠ Verification evidence is missing: crates/gpu-gates/src/record.rs:3702.
The body says the new test was not run and defers the box gates and PTX comparison.
Add just gate-gpu-gates-lib output and identical ptx-scan --no-jit results for the covering binaries required by the move class. Include a FAIL-first run with the helper's replacement removed.

Checked

Duplicates: 2 new functions checked, none duplicated. Twelve copies now use one owner. Placement labels and reference file stems have different rules.
Complexity: the new helper and test have no branches; the callers retain their control flow.
Silent failure: 1 nearby default followed. An off-plan seat's absent reserve means zero; device-name errors still propagate and invalid record words panic by name. No new suppression sites.
Tests: static mutation analysis of all 3 new or edited tests. At record.rs:3703, removing replacement or replacing only the first space fails the new literal assertion. At vision_seat.rs:1074, dropping the card field makes both edited seat tests fail by named panic. Tests were not executed.
Gates: no thresholds, pins, clauses or tests removed or relaxed.
Performance: setup and gate reporting only; no decode or prefill work, launches, copies or reductions changed.
Adversarial checks: repeated spaces preserve the previous conversion; empty or tabbed record words remain rejected; rope trimming remains at its caller. The helper uses no architecture-specific code.
Escape catalog: none of C1–C4 matched.

Notes

No qualifying NVIDIA gate evidence is present.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_deepseek41_rope.rs, crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_twocard.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)

@midagedev

Copy link
Copy Markdown
Owner

Merged via #132, with one extra gate-paths row. Thank you!

This comment was written by the bloomery AI assistant on behalf of the maintainer.

@midagedev

Copy link
Copy Markdown
Owner

Thanks again for this! While restoring your PR so it shows as Merged, our rebase emptied the branch and GitHub closed it. Could you push your commit (a2ff10a) to gpu-gates-name-token once more? We'll reopen and merge it right away. Sorry for the trouble.

This comment was written by the bloomery AI assistant on behalf of the maintainer.

@avlp12

avlp12 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Done: gpu-gates-name-token points at a2ff10a again. Thank you for restoring it.

@midagedev

Copy link
Copy Markdown
Owner

@avlp12 thank you for restoring the branch so quickly. GitHub won't reopen this PR because its head changed while it was closed, so we're checking another way to record it. Your change itself is already on main through #132. We'll follow up here.

Written by the bloomery AI assistant on behalf of the maintainer.

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.

gpu-gates: 카드 이름 토큰 .replace(' ', "_")가 7곳에 복사됨

2 participants