Skip to content

Commit both encodings of five renders, for pgb to parse - #78

Merged
turner merged 1 commit into
mainfrom
feat/cross-repo-fixture-exchange
Sep 2, 2026
Merged

turner merged 1 commit into
mainfrom
feat/cross-repo-fixture-exchange

Conversation

@turner

@turner turner commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Refs #25.

The two repositories are one contract in two halves — this one produces documents and band payloads, pgb parses them — and nothing checked that they agreed. A wire-format break reached the frontend as an error card at best and a silently wrong picture at worst.

What lands

tests/fixtures/exchange/ — both encodings of all five real subgraphs, out of one render each: the band payload /seqtubemap?format=bands returns, and the document the same request returns without it. 3.35 MB of payload and 3.22 MB of gzipped document, spanning 90 bp to the two regions at pgb's fetch ceiling. The file names are pgb's, so handing them over is a copy rather than a translation.

npm run fixtures:exchange — regenerates them from inputs already committed. No server, no vg, no graph data, no network; about two seconds, and deterministic down to the gzip, so a diff here is always something that moved.

tests/node/exchange-fixtures.test.mjs — the committed payload is the bytes this encoder writes, the committed document is the text this emitter writes, and the committed pair describes one picture, checked through pgb's own parser rather than this repository's idea of one. A sixth test nudges band 0's x1 by a part in 10,000 and asserts the pair check notices, so #25's demonstrated is a standing test rather than a story.

Docs — the fixtures README says what they are, when to re-generate, and that the copy across goes in the same window; docs/band-format.md and the seqtubemap fixtures README point at it.

Verified against pgb's reader

These exact bytes through parseBandPayload.ts and parseBands.ts at pgb fde52e3, over all 101,742 bands: band count, frame, strand names, pclaiScores, ordinates, directions, strand ids and all 1,219 segment boxes equal; abscissae and widths within one Float32 ulp — worst 0.86, 0.86, 0.44, 0.86, 0.86, which reproduces the figures pgb's own fixture notes record. Altering one float fails both sides: this one names the first differing byte, pgb puts the band 16.59 ulp from where the document does.

Against the pairs pgb captured from the live server

Same day, different provenance, and the difference is written down in the README:

  • every payload body is byte-identical, as are the header's document dimensions and all 1,219 segment boxes;
  • every strand name differs in one way — the live walks append a reference range (…#0[25397889-25398120]) that the 2026-08-27 .gfa subgraphs here predate;
  • five strands of 2,880 differ in colour and pclaiScore, having gained a placement on the server since.

What this does not close

#25's remaining criteria are pgb's. Its reader and test exist (pgb#145), but pgb has no CI — no .github/ at all — so "that test runs in pgb's CI" is still open on that side.

Testing

npm test: 132 pass, 0 fail, 2 pre-existing skips. The Python suite is untouched by this change and does not run locally here (fastapi not installed); CI installs it.

🤖 Generated with Claude Code

https://claude.ai/code/session_015wyakF7DEbvddMqaL9kSB6

The two repositories are one contract in two halves and nothing checked that
they agreed. A wire-format break reached the frontend as an error card at best
and a silently wrong picture at worst.

So both encodings of all five real subgraphs are committed under
tests/fixtures/exchange/ — the band payload /seqtubemap?format=bands returns and
the document the same request returns without it, out of one render each, under
pgb's own file names so that handing them over is a copy rather than a
translation. 3.35 MB of payload and 3.22 MB of gzipped document, spanning 90 bp
to the two regions at pgb's fetch ceiling.

`npm run fixtures:exchange` regenerates them from inputs already committed — no
server, no vg, no network — in about two seconds, and deterministically down to
the gzip. exchange-fixtures.test.mjs then holds them to the code: the committed
payload is what this encoder writes, the committed document is what this emitter
writes, and the committed pair describes one picture, checked through pgb's own
parser rather than this repository's idea of one. A sixth test nudges a band's
far end by a part in 10,000 and asserts the pair check notices, so #25's
"demonstrated" is a test rather than a story.

Verified against pgb's reader at fde52e3, over all 101,742 bands: band counts,
frame, strand names, directions, strand ids and all 1,219 segment boxes equal,
abscissae within one Float32 ulp — worst 0.86, which reproduces the figures pgb's
own fixture notes record. Against the pairs pgb captured from the live server on
the same day, every payload body is byte-identical; the strand names differ
because the live walks now append a reference range and the .gfa subgraphs here
predate that. Both facts are written down in the fixtures README, with what they
mean for anyone reaching for one set to explain the other.

Refs #25

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015wyakF7DEbvddMqaL9kSB6
@turner
turner merged commit 9b81037 into main Sep 2, 2026
2 checks passed
@turner
turner deleted the feat/cross-repo-fixture-exchange branch September 2, 2026 21:25
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.

1 participant