Skip to content

Fix cross-platform golden-byte flake from the sticky-codec election - #1132

Merged
JohannesLichtenberger merged 1 commit into
mainfrom
claude/projection-index-storage-redesign-i3849v
Jul 21, 2026
Merged

Fix cross-platform golden-byte flake from the sticky-codec election#1132
JohannesLichtenberger merged 1 commit into
mainfrom
claude/projection-index-storage-redesign-i3849v

Conversation

@JohannesLichtenberger

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the main CI failure introduced by #1131: GoldenCompositePageTest.keyValueLeafPageBytesArePinned failed on the macOS and Windows cross-platform jobs (1 of 9368 tests; the Linux jobs passed by scheduling luck). Root cause: the sticky-winner codec election makes a page's emitted codec a function of per-thread serialization history — when earlier tests in the same JVM fork drove the thread past the election warmup with an elected winner, the golden page was encoded with that winner instead of the exhaustive pick-smallest choice the pinned bytes assume. This is exactly the determinism caveat documented with the election, materializing as a cross-platform flake.

Fix: PageKind.resetStickyCodecElectionForCurrentThread() (test hook, documented) + a call in the golden test before serializing, restoring the exhaustive bake-off for the pinned page regardless of prior same-thread work.

Related issue

Follow-up to #1131 (the failing run: https://github.com/sirixdb/sirix/actions/runs/29867976108).

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Performance improvement
  • Documentation only

Checklist

  • ./gradlew build passes locally (JDK 25) — targeted verification instead (local wrapper constraint documented in Projection index storage redesign, vectorized serving generalization, and write-path speedups #1131): PageLayoutFuzzTest + KeyValueLeafTest + GoldenCompositePageTest in one JVM (heavy serialization preceding the golden pin — the exact failure ordering) — green.
  • Added or updated tests covering the change (the golden test now neutralizes election history by construction)
  • Storage-engine invariants unaffected (test-only determinism hook; no wire-format or behavior change)
  • No unrelated formatting churn

Notes for reviewers

Two-line production change (a documented ThreadLocal reset hook), one call site in the test. The alternative — pinning -Dsirix.codecBakeoff.probeInterval=1 for the whole test JVM — would stop CI from exercising the election at all; the targeted reset keeps it live everywhere else.


Generated by Claude Code

GoldenCompositePageTest.keyValueLeafPageBytesArePinned failed on the
macOS/Windows CI jobs (and passed on Linux by scheduling luck): the
sticky-winner codec election makes a page's emitted codec a function of
per-thread serialization history, so when earlier tests in the same fork
drove the thread past its warmup with an elected winner, the golden page
was encoded with that winner instead of the exhaustive pick-smallest the
pinned bytes assume — the documented determinism caveat materializing as
a flake.

Add PageKind.resetStickyCodecElectionForCurrentThread() and call it in
the golden test before serializing, restoring the exhaustive bake-off
for the pinned page regardless of prior same-thread work.
@JohannesLichtenberger
JohannesLichtenberger merged commit 17333d6 into main Jul 21, 2026
4 of 5 checks passed
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.

2 participants