Skip to content

perf(artifacts): replace quadratic ZIP overlap checks - #1013

Merged
morluto merged 1 commit into
mainfrom
codex/zip-overlap-final
Oct 7, 2026
Merged

morluto merged 1 commit into
mainfrom
codex/zip-overlap-final

Conversation

@morluto

@morluto morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Large ZIP inventories currently spend quadratic work comparing each entry range with all prior ranges. Upgrade the exact zip.js dependency from 2.8.26 to 2.15.0, which keeps indexed overlap checks and fixes the first indexed release's Buffer-view compatibility issue for REA's file-backed reader. Signature, CRC, and overlap verification remain enabled.

Use tolerant library filename parsing so decoded names reach REA's existing provider-neutral validation unchanged. Unsafe paths still return their typed path constraint rather than a generic library error. Added production inventory regressions cover overlapping entry ranges, encrypted-member observations, corrupt data/CRC, and truncated archives. Existing regressions cover unsafe names and ordering.

Bounded measurements on Node 24.18.0, three alternating pairs each:

  • File-backed overlap checks only, 4,000 entries: median 114.54 ms → 47.73 ms (58% lower), with identical entry metadata. This excludes enumeration and hashing.
  • Warmed complete inventory, 1,000 entries, using byte-identical compiled REA code with only the ZIP dependency changed: median 122.69 ms → 133.73 ms (9% slower). All six complete outputs matched, SHA-256 0c91f87b4aa49f03eba20fd680492078ab13b4adaf4a8d3d0f431d713a864675.

The optimization addresses overlap-check scaling; it does not claim a general small-archive throughput gain. Larger whole-inventory runs were intentionally avoided after the earlier worktree CPU load.

Validation: npm run build:cached, npm run check:fast, npm run docs:check, and formatting checks passed. The three focused files artifactZipIntegrity.test.ts, artifactInventoryEntryOrder.test.ts, and artifactProvider.failureDetail.test.ts passed all 20 tests with one worker. Independent Standards and Spec reviews accepted the source. Real Hopper/Ghidra verification was not performed for this archive-only change.

Upstream: indexed overlap checks, 2.15.0 release.

Related to #893.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T18:07:19.402691Z 6cde76c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit 76e7e51 into main Oct 7, 2026
27 checks passed
@morluto
morluto deleted the codex/zip-overlap-final branch October 7, 2026 18:08
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: evidence Evidence, artifacts, and reconstruction label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant