fix(tri): price the four remaining thresholds; one guards a hazard, three were not the class - #3022
Merged
Conversation
…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>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-03 12:50:40 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The short list, read by hand
§452 declined to ship a detector and left fourteen candidates. Each was priced.
quant.rs—depth > 8, the recursion cap insize_ofInstrumented over the live corpus:
and the census reads
119 / 308 / 472with 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** childreninsideBTreeNode); this corpus simply has none today.So: neither deletion nor silence — make the unreached branch reachable.
a_self_referential_struct_terminatesplants the cycle and assertsUnbounded;a_chain_shallower_than_the_cap_is_still_measuredplants a four-deep finite chain and asserts a real size, or the cap would be indistinguishable from give up on anything nested.red.rs—at_least: n >= 30againstper_page=30Two 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:
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.rsblips > 5andquiet >= 4— retry budgets, and both print their own number ("failed six times running","({quiet}/4)").quant.rse >= 8— chooses between2^eand 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
cargo test -p tri119 / 308 / 472per_page=100in the URLn > PAGEquant.rs+50 −1,red.rs+53 −2Skill §453–455.
Refs #2994
🤖 Generated with Claude Code