Skip to content

fix(tri): price the four remaining thresholds; one guards a hazard, three were not the class - #3022

Merged
gHashTag merged 3 commits into
masterfrom
loop/price-four
Sep 3, 2026
Merged

fix(tri): price the four remaining thresholds; one guards a hazard, three were not the class#3022
gHashTag merged 3 commits into
masterfrom
loop/price-four

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 3, 2026

Copy link
Copy Markdown
Owner

The short list, read by hand

§452 declined to ship a detector and left fourteen candidates. Each was priced.

quant.rsdepth > 8, the recursion cap in size_of

Instrumented over the live corpus:

calls to size_of      2078
maximum depth reached    1
guard taken              0

and the census reads 119 / 308 / 472 with the cap at 1, 2, 4, 6, 8, 12, 16, 32 or 64. Flat everywhere. By the §450 test it is not load-bearing; by §426 — a guard clause you have not executed is a comment — it looks deletable.

It is not. Remove it and the suite does not fail, it stack-overflows, on a struct whose field is itself. #2949 established one in real code (BTreeNode** children inside BTreeNode); this corpus simply has none today.

So: neither deletion nor silence — make the unreached branch reachable. a_self_referential_struct_terminates plants the cycle and asserts Unbounded; a_chain_shallower_than_the_cap_is_still_measured plants a four-deep finite chain and asserts a real size, or the cap would be indistinguishable from give up on anything nested.

Two questions look alike and are not: does this constant change a published number? (sweep it) and does this constant prevent a failure? (remove it). A constant can answer no to the first and yes to the second.

red.rsat_least: n >= 30 against per_page=30

Two literals two hundred lines apart that must agree, linked only by a comment. Raising the query alone would have kept printing + on streaks that are exact — a truncation marker that has stopped marking truncation, in the command whose whole subject is silent truncation.

One constant now. And the first test I wrote for it was a control that cannot fail:

assert!(PAGE >= PAGE);
assert!(!(PAGE - 1 >= PAGE));

The real one reads the page size back out of the URL the command sends and compares it to the count at which the marker flips.

Not the class, with the reason

  • prcheck.rs blips > 5 and quiet >= 4 — retry budgets, and both print their own number ("failed six times running", "({quiet}/4)").
  • quant.rs e >= 8 — chooses between 2^e and the literal. Display only.

And a mutation run over a file that was never mutated

Three mutants passed in a row, all green, all meaningless: the rewrite meant to change the source aborted on a failed anchor assertion before writing the file, so every mutant ran against the original. §440 wearing different clothes — there the sample was empty, here the treatment was. The helper now exits non-zero when the anchor is not found exactly once. §455.

Controls

check result
cargo test -p tri 482 passed, 0 failed
census across cap widths 1…64 identical: 119 / 308 / 472
mutation: remove the cap stack overflow — the guard is load-bearing for termination
mutation: cap = 1 red (the finite-chain test)
mutation: hard-code per_page=100 in the URL red
mutation: marker n > PAGE red
diff shape (§447) quant.rs +50 −1, red.rs +53 −2

Skill §453–455.

Refs #2994

🤖 Generated with Claude Code

gHashTag and others added 2 commits September 3, 2026 19:35
…hree were not the class

Following the 30-line window, the short list from that sweep was read by
hand and each constant was priced.

quant.rs `depth > 8`, the recursion cap in `size_of`. Instrumented over
the live corpus: 2078 calls, maximum depth reached ONE, guard taken ZERO
times -- and the census is identical with the cap at 1, 2, 4, 6, 8, 12,
16, 32 or 64. It decides nothing about any published number.

It is kept, and now it is PROVEN: removing it stack-overflows on a struct
whose field is itself, which #2949 established exists in real code
(`BTreeNode** children` inside `BTreeNode`). A guard clause nobody has
executed is a comment, so a test executes it -- with a finite-chain
counter-example beside it, or the cap would be indistinguishable from
"give up on anything nested".

red.rs `at_least: n >= 30` against `per_page=30`: two literals that must
agree, linked only by a comment. Raising the query alone would have kept
printing `+` on streaks that are exact -- a truncation marker that has
stopped marking truncation, which is what that command exists to surface.
One constant now, and the test reads the page size back OUT of the URL
and checks the count at which the marker flips.

Not the class, with the reason: prcheck.rs `blips > 5` and `quiet >= 4`
are retry budgets that print their own number, and quant.rs `e >= 8`
chooses between `2^e` and the literal.

Refs #2994

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…and a mutation over an unmutated file

453: depth>8 changes no published number at any width but removing it
stack-overflows. Two different questions, and only the second tells a
dead guard from an unexercised one.

454: per_page=30 and n>=30 were two literals linked by prose. The first
test I wrote asserted the constant against itself; the real one reads the
page size back out of the URL.

455: three mutants passed because the rewrite aborted before writing the
file. The helper now exits non-zero when the anchor is not found.

Refs #2994

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-03 12:37:16 UTC

Summary

Status Count
Total Open PRs 12
PRs with Failing Checks 10
PRs with All Checks Green 2
READY 0
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=a64be3550ca2 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-03 12:50:40 UTC

Summary

Status Count
Total Open PRs 11
PRs with Failing Checks 10
PRs with All Checks Green 1
READY 0
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=c150ac8923c5 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit ade28e9 into master Sep 3, 2026
36 checks passed
@gHashTag
gHashTag deleted the loop/price-four branch September 3, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant