Skip to content

docs(rules): correct the RANDOM and extdebug claims with measurements - #1364

Merged
Chemaclass merged 1 commit into
mainfrom
docs/1354-correct-random-and-extdebug-claims
Sep 9, 2026
Merged

docs(rules): correct the RANDOM and extdebug claims with measurements#1364
Chemaclass merged 1 commit into
mainfrom
docs/1354-correct-random-and-extdebug-claims

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1354

Two claims in the rules files were relied on while planning performance work. Both are wrong — and for RANDOM, so is the correction the issue proposes.

💡 Changes

  • RANDOM. The rules said a subshell inherits the state; the issue says bash reseeds per subshell. The second holds in a plain shell but not in the context the claim is about:

    Context three consecutive $( ) reads
    Plain shell — 3.00.22, 3.2.57, 4.4, 5.2, 5.3 differ
    --parallel worker — Linux 3.0, 5.2 differ
    --parallel worker — macOS 3.2.57 identical

    So it is neither reliably shared nor reliably reseeded — platform and nesting depth both matter. The ordinal scheme (perf(runner): ordinal result-file naming in parallel workers (drop mktemp+mv per test) #851) stands for a stronger reason than either version of the claim. Deliberately not asserted in a test: pinning either direction would make one platform red. $$ inheritance, the half the design rests on, is pinned.

  • extdebug. shopt -u extdebug clears errtrace/functrace, silently turning off what --strict runs on. The issue puts the boundary at 5.2; measured, it is 4.4 (4.0–4.3 leave them alone). The table now sits at the two call sites that depend on it, and a test pins it per version — verified green on 3.0, 4.3, 4.4 and 5.2, so both sides of the boundary are exercised.

No CHANGELOG entry: contributor rules and comments only.

https://claude.ai/code/session_01EXYWTGLjf7qM8Ru3GakDRm

Two claims were relied on while planning performance work. Both are
wrong, and one of the proposed corrections is wrong too.

RANDOM. The rules said a Bash 3 subshell inherits the RANDOM state, and
gave that as the reason a --parallel worker cannot mint a unique token.
The issue's correction -- that bash reseeds RANDOM per subshell on every
supported version -- holds in a plain shell but not in the context the
claim is about:

  plain shell, 3.00.22 / 3.2.57 / 4.4 / 5.2 / 5.3   three reads differ
  --parallel worker, Linux 3.0 and 5.2              three reads differ
  --parallel worker, macOS 3.2.57                   three reads IDENTICAL

So RANDOM is neither reliably shared nor reliably reseeded: it depends on
the platform and on nesting depth. The ordinal scheme (#851) stands, for
a stronger reason than either version of the claim. Nothing is asserted
about RANDOM in a test, because pinning either direction would make one
platform red; `$$` inheritance, which is the half the design rests on, is
pinned.

extdebug. `shopt -u extdebug` clears errtrace and functrace on newer
builds, silently turning off what --strict error tracing runs on. The
issue put the boundary at 5.2; it is 4.4:

  3.00.22, 3.2.57, 4.0, 4.1, 4.2, 4.3   leaves them as they were
  4.4, 5.2.37, 5.3.15                    clears both

The table now sits at the two call sites that depend on it, and a test
pins it per version -- verified green on 3.0, 4.3, 4.4 and 5.2, so both
sides of the boundary are exercised rather than assumed.

Closes #1354

Claude-Session: https://claude.ai/code/session_01EXYWTGLjf7qM8Ru3GakDRm
@Chemaclass Chemaclass added the documentation Improvements or additions to documentation label Sep 9, 2026
@Chemaclass Chemaclass self-assigned this Sep 9, 2026
@Chemaclass
Chemaclass merged commit 26959fa into main Sep 9, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the docs/1354-correct-random-and-extdebug-claims branch September 9, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant