Skip to content

Store the largest IGeo7 oracle as a zstd frame - #27

Open
asinghvi17 wants to merge 1 commit into
mainfrom
claude/igeo7-oracle-zstd
Open

Store the largest IGeo7 oracle as a zstd frame#27
asinghvi17 wants to merge 1 commit into
mainfrom
claude/igeo7-oracle-zstd

Conversation

@asinghvi17

Copy link
Copy Markdown
Member

test/systems/IGeo7/vectors/dggrid_true_res5_centers.txt is the largest tracked
file in the repo: 7.6 MB, 168,072 rows, every cell at IGeo7 level 5. That is 86%
of the 196,080 rows the oracle carries, and roughly 3.4 MB of a clone once git's
zlib has had it.

Stored as a zstd frame it is 2.7 MB, on disk and in the pack both.

The oracle does not change

zstd -dc on the new file reproduces the old one byte for byte — same git hash,
533fb6faa74fff8674d9441278cc3e6ed30145f2. This is a re-encoding, not a
regenerated dump, so there is no possibility of the digits having quietly moved.

The suite confirms it from the other side: testset 4 still reports a worst
centroid error of 5.913e-09 deg at every level 1–5, against the 1e-8 it
allows, with zero decode mismatches.

Why compression and not precision

Trimming the coordinates to ten decimal places was the alternative. It saves
less — 6.0 MB raw, 2.6 MB packed — and it spends margin this test does not have
to spare: the observed error is already 6e-9 against a 1e-8 threshold, under a
factor of two, and once trimmed the digits cannot be recovered without rerunning
DGGRID.

on disk in the pack
today 7.6 MB ~3.4 MB
10 decimal places 6.0 MB 2.6 MB
zstd -19, full precision 2.7 MB 2.7 MB

The loader

load_true_centers takes whichever of dggrid_true_res{r}_centers.txt or
…​.txt.zst is on disk. Only level 5 is converted here: level 4 is 1.1 MB and
level 3 is 155 KB, small enough that staying greppable is worth more than the
bytes. Dispatching on the extension means converting another one later needs no
change to this function.

CodecZstd becomes a declared test dependency. It was already in the manifest
transitively (via Healpix), so it costs no new download.

🤖 Generated with Claude Code

`dggrid_true_res5_centers.txt` is 7.6 MB, the largest tracked file in the repo
and about 3.4 MB of a clone once git's zlib has had it. It is 168,072 rows —
every cell at level 5, which is 86% of the 196,080 rows this oracle carries.

Compressed it is 2.7 MB, on disk and in the pack both. Nothing about the oracle
changes: `zstd -dc` on the new file reproduces the old one byte for byte, same
git hash, so this is a re-encoding and not a regenerated dump. The suite still
reports the same 5.913e-09 deg worst centroid error at every level, against the
1e-8 the test allows.

Compression rather than precision, deliberately. Trimming the coordinates to
ten decimals would save less (6.0 MB, 2.6 MB packed) and spend real margin: the
observed error is already 6e-9 against a 1e-8 threshold, so there is under a
factor of two to give away, and once trimmed it cannot be recovered without
DGGRID.

`load_true_centers` now takes whichever of `.txt` or `.txt.zst` is present.
Only level 5 is converted — level 4 is 1.1 MB and level 3 is 155 KB, small
enough that staying greppable is worth more than the bytes — and dispatching on
the extension means converting another later needs no further code change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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