Skip to content

lfc-pack 1.2.4: idle repack at Zstandard level 9 - #995

Merged
JNFoo merged 63 commits into
mainfrom
claude/project-thread-lykxid
Dec 3, 2026
Merged

JNFoo merged 63 commits into
mainfrom
claude/project-thread-lykxid

Conversation

@JNFoo

@JNFoo JNFoo commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Requested by the owner · project thread

What

lfc-pack 1.2.4, the owner's choice on the 12.3 card "Which zstd level should LFCP's background repack use?": Level 9.

  • The idle repack (pairs: true) now writes its Zstandard frames at level 9. The default Save keeps level 3 and writes the same bytes as 1.2.3.
  • The idle repack also tries links priced up to 25% over a column's own size. The price estimate is rough, and at level 9 the edit test's compact lost a link without this.
  • Version labels are brought in line everywhere: README tables, demos.html, llms.txt, and the private changelog entries for 1.2.1 to 1.2.4.

Numbers

  • Idle file size against 1.2.3: online retail 0.966, SBA 0.969, SBA late 0.960, SEC numbers 0.952, SEC pre 0.910, SEC submissions 0.946. All read back value-exact.
  • Idle repack time: 1.33-1.73x longer in Chromium 156, 1.38-1.66x in Firefox 158, 1.37-1.67x in WebKitGTK 2.52.6.
  • Reads even in both load orders.
  • Node test set and v2 tests pass.

Generated by Claude Code

JNFoo and others added 30 commits November 29, 2026 14:52
…or for old files

Pages of 65,536 values, encodings chosen on a sample, shared word lists
(sorted and front-coded when smaller), links between columns (chains and
two-column links), old files sent to the format-1 reader.

Co-Authored-By: Claude <noreply@anthropic.com>
…start head with exact types and facts

Co-Authored-By: Claude <noreply@anthropic.com>
…r and reader

Co-Authored-By: Claude <noreply@anthropic.com>
…o, Codex handoff

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…% and 2 KB; memory-compression needs a 5% margin

Co-Authored-By: Claude <noreply@anthropic.com>
…irs); link-source codes kept beside the arrays on read

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…rce codes

Co-Authored-By: Claude <noreply@anthropic.com>
…ead-all 0.73-0.93 of before on e-commerce)

Co-Authored-By: Claude <noreply@anthropic.com>
…lf the time)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…es, appends re-packed columns, new index and head, counts dead bytes; compact repack

Co-Authored-By: Claude <noreply@anthropic.com>
…ugh unpatched values); re-pack past 5% of rows

Co-Authored-By: Claude <noreply@anthropic.com>
…ks sorted by source; edits and repacks keep parts

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ted text columns drop the words-sorted flag

Co-Authored-By: Claude <noreply@anthropic.com>
…nks from their sources' first rows)

Co-Authored-By: Claude <noreply@anthropic.com>
- Start head is 24 bytes plus body plus empty room; data starts after the room.
- Edit saves rewrite the head in place at the start (or move every piece once
  when it outgrows the room); no head copy at the end of the file any more.
- Parts directory (extra tables, documents, files) is in the start head.
- Streams: declared column types in the start head, a facts header at the
  front of each page group, and finalHead() with the whole stream's facts.
- Word lists restart their shared-start chain every 1,024 words
  (someWords/codesIn read a few without decoding all).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ll 17% faster)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…33% faster)

The main thread finds the words of text columns with repeats (Map on the original
strings, whose hashes the engine already has) and sends only typed arrays; helpers
used to hash every value again. Mostly-distinct columns keep the byte path.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ole columns)

Co-Authored-By: Claude <noreply@anthropic.com>
JNFoo and others added 27 commits November 30, 2026 16:07
…eadAll

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… CRC-32)

Requested by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
packColumnsParallel writes format 2 (start-head metadata, word lists, column
links, edit-in-place saves, streams) through the new LfcPack.tables API.
JSON rows and the format 1 extras keep format 1 until 1.1. unpackColumns,
unpackColumnsParallel and unpackRows read both formats. Folds in the 0.27.3
M-encoding fallback (PR 976). zstd-kit 1.1.0 adds decompressInto.

Requested by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
…ays save as numbers

packColumnsParallel validates columns as before (colTable), keeps text-bytes,
dictionary and timestamp holders on format 1, and copies Int32Array and other
typed number arrays to Float64Array for format 2. b34 and packblockcols check
format 1 behavior, so they pass format: 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
- lfc-pack vs Parquet tester: date columns go in as numbers, so every lfc-pack file it makes is format 2; wording says so
- viewer: opens format 2 tables and streams (column facts from the start head, first rows only)
- tests/lfc-pack-v2-browser.js: save, read, readRows, edit, stream, parts and refusals in one browser

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
…foundry/JS-modules into claude/project-thread-lykxid

# Conflicts:
#	modules/lfc-pack/CODEX-2026.11.30.md
- python/lfc_pack.py: read_table, table_head, read_parts; read, read_text, info and metadata take format 2 files
- go-reader/v2.go: lfcp-read head, exact, parts; rows, text and info take format 2 files; web build refreshed
- both read every format 2 encoding, links, edits, streams and parts; number pages in memory-compression 2.x
  blocks are refused with a plain message until Thursday (owner's choice)
- test/v2/vectors.cjs makes format 2 files fresh for both readers (run.js steps; go-reader/check_v2.py)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
In the idle repack (pairs: true, or templates: true), a text column built
from other text columns plus fixed text is stored as a few patterns and one
small code per row. SBA awards 33% smaller; held-out SEC submissions 18% and
SBA late awards 30% smaller. Reads even with 1.0.1 in 3 browsers; default
Save unchanged. Files with templates set format minor 1; JS, Python and Go
readers read them, 1.0.x refuses them with a plain message.

Requested by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
…y number column

- A column that follows another stays linked when the first row of a group is
  an odd one (each group's most common value is tried when the first row breaks
  the 1% limit); links are committed by estimated saving. E-commerce with 100
  copied cells: 483,675 to 339,326 bytes. Default Save even with 1.1.0.
- Python and Go readers decode memory-compression 2.x number blocks, checked
  bit for bit on 19 more picker columns.
- No NUL byte in lfc-pack.js, lfc-pack-read.js and viewer.html.

Requested by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Format 2 code and memory-compression are now made on first use, and format 1
helper workers skip them, so helper set-up is back to 0.27 levels in three
browsers. Same bytes as 1.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Workers that load lfc-pack.js and call init() no longer compile format 2's
WebAssembly; it gets ready on first use (sync calls compile Zstandard at
once). Same bytes, no API change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
lfc-pack.js 1.88 MB to 1.45 MB: the memory-compression copy is now its
packing core, number picker and helpers plus a small wrapper, with the same
bytes (checked against the full module in test/v2/mcslim.test.js). Workers
start 4 to 12 ms faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
Owner's choice: the idle repack (pairs: true) writes level 9 frames, files 3
to 9% smaller on six tables, repack 1.3 to 1.7 times longer, reads even. The
repack also tries links priced up to 25% over a column's size. Default Save
unchanged. Version labels brought in line everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpxKcXFm1eYVfMfeZ8kzG7
@JNFoo JNFoo self-assigned this Dec 3, 2026
@JNFoo
JNFoo merged commit d9580cf into main Dec 3, 2026
3 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