Skip to content

lease: the perf stub matches the symbol argument, so a TMPDIR holding next no longer skips its held calls - #1004

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-lease-perf-stub-arg
Oct 30, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-lease-perf-stub-arg

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

tools/ref/lease.sh --self-test의 perf stub이 경로에 next가 들어 있는 TMPDIR에서 심볼 호출을 건너뛰던 것을, 심볼 인수만 보도록 고칩니다.

What and why

In tools/ref/lease.sh --self-test, the perf stub for perf annotate and perf report exited early when next appeared anywhere in its arguments. The arguments include the -i path under $TMPDIR, so a TMPDIR containing next made the stub skip the held call for the stub symbol. The bounded perf annotate and callers self-test steps then went wrong. The stub now walks the arguments and exits early only for -s next or -S next. The perf phase directory is named perf-next -s next -S next <phase>, so the existing assertions exercise both cases on any TMPDIR.

Release notes: internal: the lease self-test no longer depends on the name of its temporary directory.

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; 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

Before the fix, with a TMPDIR whose path contains next:

$ d=$(mktemp -d)/next-repro; mkdir -p "$d"; TMPDIR=$d bash tools/ref/lease.sh --self-test
FAIL bounded-perf-annotate-ready: got [no], want [yes]
FAIL bounded-perf-annotate-lease-held: got [free], want [held]
FAIL bounded-perf-annotate-term-rc: got [0], want [143]
FAIL bounded-perf-annotate-stopped: got [1], want [0]
FAIL bounded-perf-callers-ready: got [no], want [yes]
FAIL bounded-perf-callers-lease-held: got [free], want [held]
FAIL bounded-perf-callers-term-rc: got [0], want [143]
FAIL bounded-perf-callers-stopped: got [1], want [0]
self-test: FAIL (8 failures)

After the fix, with the default TMPDIR:

$ bash tools/ref/lease.sh --self-test
ok bounded-perf-annotate-ready
ok bounded-perf-annotate-lease-held
ok bounded-perf-annotate-term-rc
ok bounded-perf-annotate-term
ok bounded-perf-annotate-stopped
ok bounded-perf-callers-ready
ok bounded-perf-callers-lease-held
ok bounded-perf-callers-term-rc
ok bounded-perf-callers-term
ok bounded-perf-callers-stopped
self-test: ok (0 failures)

AI help

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

@github-actions github-actions Bot added the tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo label Oct 30, 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 stub matches symbol arguments and preserves held calls when temporary paths contain next.

Checked

Duplicates: 0 new functions, types or constants; grep found no sibling matcher with the same defect. No dryer pairs were available.
Complexity: no Rust functions changed; the argument scan is bounded by the argument count.
Silent failure: 0 new suppression sites; nonmatching arguments still reach the held-call executable.
Tests: syntax validation and 15 isolated argument cases passed. Mutation analysis at tools/ref/lease.sh:1690: restoring *next* skips the held call with the revised fixture, so the existing readiness assertion fails.
Gates: no thresholds, assertions or cases were removed or relaxed. The PR body includes FAIL-first output.
Escape catalog: no changed code matches C1–C4. The stub heredoc is quoted, and the new path remains quoted at its consumers.

Notes

Dryer and crapper did not run because no Rust file changed.
The full cancellation self-test was not run; validation covered syntax and isolated argument handling.

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

Labels

tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant