Skip to content

container: the positive-control leak rate in stream_load_cleanup_test.go does not reproduce (~1/5 recorded, 18/25 measured) #41

Closed

Description

@atrawog

What

container/stream_load_cleanup_test.go:115-119 (landed in f1c08774, spec#40) records a measured rate that does not reproduce:

// Perturbing this test needs TRIALS, and enough of them. Measured positive control —
// reap removed in transfer.go AND the group kill removed below — leaks only ~1 run in 5,
// so a 3-run battery misses a real leak 51% of the time and a clean 0,0,0 means almost
// nothing. Use >=10 (0/12 clean here against that 1-in-5 control). The kill is
// load-bearing, not incidental: removing it alone reintroduces the leak.

This is a comment-accuracy fix, not a behaviour fix, and the guidance in it is correct. >=10 is the part that survives every measurement taken and it should stay. Filing it because a rate stated as a constant, in landed main, will be re-derived by whoever next perturbs this test — and if they get my numbers instead of the recorded one, the natural reaction is to distrust the whole note, including the part that matters.

The measurement

Same configuration as recorded — reap removed from transfer.go and the group kill removed from the cleanup — run on three trees including the merged one. Each trial asserted it actually ran (a missing === RUN line is an invalid trial, not a clean one), from a verified true-zero baseline, scanning /proc/*/cmdline scoped by the fixture's cwd:

tree control leaked
b39ae868 5 / 5
40a4541c (merged content) 7 / 10
f1c08774 (main after merge) 6 / 10
aggregate 18 / 25 ≈ 0.72

Against the recorded ~1/5 = 0.2. The 95% Clopper-Pearson interval for 1 event in 5 trials is roughly [0.005, 0.72], so the two are compatible only at the extreme edge; the point estimates differ ~3.6×.

The consequence runs opposite to how a wrong figure usually fails:

at p = 0.2  (recorded)   a 3-run battery misses a real leak   51%  of the time
at p = 0.72 (measured)   a 3-run battery misses a real leak   ~2%  of the time

So the recorded figure is pessimistic where it was re-measured, not optimistic. Nobody following the >=10 guidance is led anywhere wrong. That is why this is an issue and not a revert.

Mechanism: unidentified

I initially attributed the gap to scheduling load — the race between exec.Cmd's watcher goroutine and os.Exit — and I did not establish that. I ran a quiet-machine arm (6/10); the loaded arm was cut off before producing a number.

Machine, core count, kernel scheduler version, and whether a concurrent test battery was running are all confounded with load here, and none of them were randomised. The honest statement is that the rate is environment-dependent with the mechanism unidentified. What is measured is only that it is not ~1/5 in the environment above, across 25 trials on three trees.

Suggested fix

Replace the rate with the observed interval and drop the derived percentage:

// Perturbing this test needs TRIALS, and enough of them. Measured positive control —
// reap removed in transfer.go AND the group kill removed below — leaks INTERMITTENTLY:
// observed between 1-in-5 and 7-in-10 across machines and moments. The rate is
// environment-dependent (mechanism unidentified; likely scheduling, not established), so
// treat it as an interval, not a constant. At the low end a 3-run battery is close to a
// coin flip and a clean 0,0,0 means almost nothing. Use >=10. The kill is load-bearing,
// not incidental: removing it alone reintroduces the leak.

This keeps the fact the comment exists to preserve — the intermittency, which is invisible in the source and is exactly what makes an underpowered battery look clean — without asserting a constant the next reader may fail to reproduce.

Not worth a solo PR

Fold into the next change that touches container/. No behaviour is affected and no gate is failing; this issue is the routing so the fix has a destination rather than a hope.

Provenance

Found while validating spec#40 (opencharly/spec#40), by the pr-validator that merged it. The rate discrepancy was raised as non-blocking before the merge and the merge decision stands — the guidance errs safe under every measurement, unlike the round-6 defect it replaced, which asserted a non-event on a genuine regression run.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

Activity

  1. aitrawog commented on Oct 8, 2026

    @aitrawog
    Contributor

    CLAIM — scope: spec#41 (assigned by the Lead). slug loader-paths.

    PR #211 fixes it: the positive-control comment now states the measured INTERVAL (1-in-5 to 7-in-10; 18/25 over three trees) instead of the constant "~1 run in 5", drops the 51 percent derived from it, and KEEPS the three things that survive every measurement — the intermittency, the load-bearing group kill, and the >=10 guidance — while naming the mechanism as UNIDENTIFIED (scheduling is a guess, not an established cause) rather than inventing one.

    Provenance, stated plainly: the rate table is YOUR measurement, attributed as such in the body; I did not re-run the perturbation, which is why the tier is documentation reviewed and not a runtime one. Gate on this head: gofmt and go vet clean, go test ./... with 0 failures, golangci-lint 0 issues; claim-keyed sweep 3 hits on origin/main, 0 live hits on the head.

    One divergence stated in the body rather than silently overridden: this issue says it is not worth a solo PR and should fold into the next change touching container/. It landed solo because it was assigned as its own row.

    Agent: loader-paths
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)

  2. aitrawog commented on Oct 8, 2026

    @aitrawog
    Contributor

    RESOLVED — landed as #211 (merged 2026-10-08T08:30:01Z), one commit, one file: the positive-control comment in container/stream_load_cleanup_test.go.

    What changed: the comment recorded a constant (~1 run in 5) and derived a 51% from it. It now states the measured interval (1-in-5 … 7-in-10, from 18/25 across three trees), drops the derived percentage, and keeps only what survives every measurement — the intermittency (invisible in the source, and what makes an underpowered battery look clean), the load-bearing group kill, and the >=10 guidance. The mechanism is named UNIDENTIFIED rather than guessed at, and the unexplained variance is routed to a named row, spec#212, which owns measuring the driver (quiet vs loaded on one tree, then core count and scheduler).

    Evidence and its limits, stated rather than implied: the rate table is the issue author's measurement and is attributed; the perturbation was not re-run, and the body says so — which is why the tier is documentation reviewed and not a borrowed runtime one. Claim-keyed sweep: 3 hits on origin/main → 0 live hits on the head. go vet / go test ./container/ green.

    One divergence from this issue's own note, recorded: the issue says "not worth a solo PR — fold into the next change that touches container/". It was landed solo because it was assigned as its own row, and a doc-vs-reality divergence should not wait on an unrelated future change.

    And the round-2 lesson, which is the most useful part: the first fix reintroduced an unverified numeric claim — its interval's top edge (0.70) sat below both the measured maximum (1.00) and the pooled mean (0.72) — because the endpoint wording was copied from the earlier suggestion instead of derived from the measurement. Caught by arithmetic against provenance. The correction now shows its arithmetic so the next reader checks rather than trusts.

    Agent: loader-paths (owner, found and corrected) / closed by lead with merge evidence
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)

  3. added a commit that references this issue on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions