Skip to content

fix(compression): bump vendored GCF with numeric-domain and surplus fixes - #10807

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
blackwell-systems:feat/gcf-bump-2.6.1
Aug 21, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
blackwell-systems:feat/gcf-bump-2.6.1

Conversation

@blackwell-systems

Copy link
Copy Markdown
Contributor

Summary

  • Bring the vendored GCF (Headroom codec) current with two correctness fixes it has lacked since the v3.2 vendoring (feat(compression): replace headroom tabular encoder with vendored GCF #4167, feat(compression): update vendored GCF (Headroom) codec to spec v3.2 — nested flattening #6838). Both are losslessness-safety fixes at the codec boundary; behavior is unchanged for every payload except the two edge cases below, which previously round-tripped incorrectly.
    • Numeric domain (encode). scalar.ts formatNumber emitted plain-decimal up to 1e21, so an integer-valued double in [2^53, 1e21) was written as a bare integer that is ambiguous with an int64 and beyond the JS safe-integer range. Gate the plain form at 2^53 and use exponent form above it (SPEC 2.3.1). Shorter than the bare integer, so no budget regression.
    • Root-array count (decode). decode_generic.ts discarded parseArrayFromHeader's consumed count, so a wire declaring fewer rows than it carried silently dropped the surplus. Verify the consumed lines cover the document and throw count_mismatch otherwise (SPEC §13).

Related Issues

Validation

  • Change type: other (compression codec, open-sse/services/compression/engines/headroom/gcf)
  • Focused tests and category gates: the two new compression tests plus the existing gcf-inline-array-quote test pass locally
  • [~] npm run lint: prettier is clean on the touched files; the full check:compression-budget and typecheck:core gates could not run in my environment (missing optional omniglyph dependency) and are left to CI (docs: official 'golden path' contribution guide by change type #8329)
  • Reconciled with the current active release base (release/v3.8.50, 0 commits behind at push)
  • Production-code changes include new automated tests in this PR

Tests Added Or Updated

  • tests/unit/compression/gcf-numeric-domain.test.ts (new) — integer-valued double at/above 2^53 renders in exponent form, not a bare integer
  • tests/unit/compression/gcf-count-mismatch.test.ts (new) — a root array carrying more rows than its declared count throws count_mismatch; an exact count decodes normally

Coverage Notes

  • Touches open-sse/services/compression/engines/headroom/gcf/{scalar.ts, decode_generic.ts}. The two new tests cover both changed branches (the numeric formatting boundary and the root-array surplus guard). No touched file loses coverage.

Reviewer Notes

  • Surgical by design: the encode change is boundary-only (values < 2^53 are byte-for-byte identical), and the decode change adds a guard that turns a previously silent truncation into an explicit error. generic.ts is intentionally left untouched to avoid a lint-staged prettier reformat of its pre-existing long lines. The vendored file headers note both fixes and the README credits entry is refreshed to match.

…ixes

The vendored GCF generic encoder/decoder was current with spec v3.2. Two
correctness fixes shipped upstream since; port both, each with a regression test.

- formatNumber gated plain-decimal at abs < 1e21, so an integer-valued double in
  [2^53, 1e21) emitted as a bare-integer token: indistinguishable from an int64 on
  the wire and beyond a JS decoder's safe-integer range (2^53-1), so rejected or
  misread on decode. Gate at 2^53 so such values render as exponent (SPEC 2.3.1).
- The root-array decode discarded parseArrayFromHeader's consumed count, so a wire
  declaring fewer rows than present silently dropped the surplus. Verify consumed
  covers the whole document and throw count_mismatch otherwise (SPEC 13).

The existing B-GCF-QUOTE inline-array-quote guard still passes.
@diegosouzapw
diegosouzapw merged commit 45b42ec into diegosouzapw:release/v3.8.50 Aug 21, 2026
5 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ixes (diegosouzapw#10807)

Validado no worktree combinado do lote: typecheck:core, lint, gates de qualidade e os novos testes gcf-numeric-domain/gcf-count-mismatch verdes (mais os já existentes do codec GCF). Fix de losslessness bem documentado e cirúrgico. CI vermelho neste PR é o base-red já rastreado em diegosouzapw#9985. Obrigado!
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