Skip to content

🧪 test(archive,index): close the surviving mutants - #2256

Merged
gaborbernat merged 2 commits into
mainfrom
test/small-crates-mutants-1893
Sep 9, 2026
Merged

🧪 test(archive,index): close the surviving mutants#2256
gaborbernat merged 2 commits into
mainfrom
test/small-crates-mutants-1893

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Full-crate mutation runs over peryx-archive and peryx-index reported 45 and 12 surviving mutants, each one a place where the code could behave another way and no test would notice. The third crate in this batch, peryx-test-support, generates no mutants: .cargo/mutants.toml has excluded it since #2165, because a behaviour change in the shared harness either breaks a test that depends on it or reaches nothing.

Most survivors sat on boundaries the suites approached without landing on, so closing them meant driving the exact value. A chunk starting at a member's end, a read window ending on the inspection limit, a container stack at the depth limit and a container at the size limit, a central directory at its byte budget, an end-of-central-directory record carrying its declared comment, an entry whose extra field and comment the directory walk steps over, and a negative-cache entry that weighs its budget to the byte.

The rest marked spellings where the operator decided nothing, and the standing ruling for this campaign is to change such code until the choice carries meaning. Disjoint bits make | and ^ indistinguishable in READABLE_FLAGS, so it is now the literal it always denoted. A trimmed text chunk ends inside its member, so its successor is unconditional. A seeked zip read at offset zero performs the same read as the streaming path it guarded against. FileRangeReader's five seek arms reduce to one saturating_add_signed and a shared clamp, which fixes SeekFrom::Current with a positive offset taking the absolute value of a number already known non-negative. The flight gate published a join count no subscriber reads, since a subscriber waits for the next join instead of counting them, so the channel now carries the event alone. composed_indexes drove a hand-rolled cursor whose mutation to *= produced a loop with no exit; walking a range says the cursor only moves forward, so any mutation of it changes what the function returns rather than whether it returns.

Choosing between slicing a stored nested container in place and spilling a compressed one to a temporary file showed up only in the bytes both paths produce. A test module mounted in source.rs now reads the resolved source's path, start and length, and pins that an encrypted stored member takes the copy path.

Refs #1893

A full-crate mutation run left 45 survivors. Most were boundaries the suite
approached but never landed on: a chunk starting at the member's end, a read
window ending exactly at the inspection limit, a container stack at the depth
limit, a nested container at the size limit, a central directory at its byte
budget, an end-of-central-directory record carrying its declared comment, and an
entry whose extra field and comment the walk has to step over.

The rest marked spellings where the operator carried no meaning, which the
campaign treats as code to fix rather than mutants to excuse. Disjoint bits make
`|` and `^` indistinguishable in the readable-flags mask, so it is now the
literal it always denoted. A trimmed text chunk ends inside the member, so its
successor is unconditional and the guard that recomputed it is gone. A seeked
zip read at offset zero performs the same read as the streaming path, so the
`offset > 0` guard chose between identical results. The range reader's five seek
arms reduce to one saturating_add_signed and a shared clamp, which also fixes
`SeekFrom::Current` with a positive offset having taken the absolute value of a
value already known non-negative.

Slice-versus-spill selection for a nested container was asserted only through
its output bytes, which both paths produce. The new tests mount in source.rs and
read the resolved source's path, start and length, so the choice itself is
observable, including that an encrypted stored member is copied rather than
sliced.

Refs #1893
A full-crate mutation run left eight survivors and four timeouts. The negative
cache accounted for most: nothing pinned its eight-mebibyte budget, nothing
admitted an entry at exactly that budget, and the wall-clock entry point was
driven only by a deadline already past, so its maintenance sweep never had to
tell a live entry from an expired one.

Three timeouts and one survivor came from spellings where the operator decided
nothing. The flight gate published a join counter that no subscriber reads,
since a subscriber waits for the next join rather than counting them; a unit
watch channel says that, and drops an increment that under `*=` never advances.
composed_indexes drove its own cursor into a `while let`, which the same
mutation turns into a loop that never terminates. Walking a range instead says
the cursor only moves forward, and any mutation of it changes what the function
returns rather than whether it returns.

Refs #1893
@gaborbernat gaborbernat added type:test Testing, conformance, metrics, or validation coverage area:tests Conformance, perf tests, and observability labels Sep 9, 2026
@codspeed-hq

codspeed-hq Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 133 skipped benchmarks1


Comparing test/small-crates-mutants-1893 (caac498) with main (d29e3ae)

Open in CodSpeed

Footnotes

  1. 133 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@gaborbernat
gaborbernat merged commit 395c0ae into main Sep 9, 2026
22 checks passed
@gaborbernat
gaborbernat deleted the test/small-crates-mutants-1893 branch September 9, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Conformance, perf tests, and observability type:test Testing, conformance, metrics, or validation coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant