Route the 26 raw Buffer reads in GgufHeader and the 2 in
SafetensorsHeader through BinaryReader. Add u8, i8, i16, i32, i64,
f32 and f64 accessors to BinaryReader, with the same range checks as
u16/u32/word, since GGUF metadata stores signed and floating scalars.
Every migrated site reads an exact-size buffer from
ModelHeaderReader.take(), so outputs and errors are unchanged.
Shrink the raw-buffer-read baseline from 102 files / 711 sites to
100 / 683.
Refs #11865
Move the CUDA fatbinary, Clang offload bundle, CCOB, AMDGPU metadata
and inventory reads in src/gpu onto BinaryReader and drop the four
files from the raw-buffer-read baseline. GpuSource.read already admits
every range, so refusals are unchanged.
Refs #11865
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(erlang): disclose BEAM bytes trailing the declared FOR1 form
A conformant FOR1 container sizes its form to the whole file, so bytes
past the form end are an unexamined appended or corrupt region. The
inspector decoded chunks only within the form but still reported
coverage.status "complete" with no mention of the surplus, so a caller
could not distinguish a clean BEAM from one carrying foreign trailing
bytes.
Compute the trailing byte count, report coverage.status "partial" with a
trailing_bytes field, and append a limitation naming the form end and the
unexamined count. Clean containers stay "complete" with trailing_bytes 0.
* fix(erlang): reparse retained BEAM Evidence without the trailing-bytes field
Evidence retained by a build predating coverage.trailing_bytes has no such
property, and projectErlangBeamView reparses that record with the strict
erlangBeamSchema. A required field rejected those records with an input error
before any summary or page could render, breaking the offline retained-Evidence
flow even for clean files.
Default coverage.trailing_bytes to 0 so historical records reparse while every
new parse still emits the concrete count and preserves each record's stored
status.
* fix(erlang): keep retained BEAM trailing coverage unknown, not zero
Defaulting coverage.trailing_bytes to 0 manufactured a "no trailer" reading for
Evidence retained before the field existed, even when its retained bounds
(artifact.bytes versus form.location.bytes) prove a trailer. Make the field
optional so a pre-field record reparses as unknown instead of a fabricated
zero, while every new parse still emits the concrete count.
* fix(erlang): admit chunk extents before applying count limits
* docs(erlang): explain trailing BEAM coverage
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* refactor(ntfs): decode attributes within their declared values
* refactor(ntfs): bound USN journal record reads (#12216)
refactor(ntfs): bound USN record fields with BinaryReader
* fix(desktop): reject split ZIP volume metadata
Refs #12137
* refactor(zip): read Zip64 disk fields through BinaryReader
* fix(desktop): validate ZIP extra fields before selection
Refs #12146
* fix(desktop): keep bounded ZIP pairing compatible with Python 3.9
* fix(desktop): retain exact counts in bounded Zip64 views
* fix(desktop): follow the declared Zip64 directory frame
* fix(desktop): recognize empty ZIP state views (#12163)
* fix(desktop): recognize empty ZIP state views
(cherry picked from commit 263b25bd34)
* fix(desktop): reuse empty ZIP admission for wrapped documents
* refactor(zip): share the local-header signature with desktop state
---------
Co-authored-by: wunianze666-netizen <wunianze666@gmail.com>
* test(zip): inherit the portable ZIP count deadline
---------
Co-authored-by: wunianze666-netizen <wunianze666@gmail.com>
* refactor(zip): read EOCD and trailing archive fields via BinaryReader
* perf(domain): avoid subarray allocations in BinaryReader and prefilter EOCD scan
Check field bounds via a private helper and read 16-, 32-, and 64-bit
integers directly from BinaryReader.bytes by offset instead of slicing
via range(), and skip non-0x50 bytes before full signature comparison
in zipEndOfCentralDirectoryCandidates.
* perf(zip): scan EOCD signature candidates with Buffer.lastIndexOf
Jump directly between 4-byte EOCD signatures with Buffer.lastIndexOf
instead of probing every byte in JavaScript, preserving reverse
candidate order, earliest-offset bounds, and zero-copy Uint8Array views.
* perf(zip): bound EOCD lastIndexOf scan to the 65557-byte tail window
Slice a zero-copy tail view starting at earliest before calling
Buffer.lastIndexOf so exhausting zipEndOfCentralDirectoryCandidates on
large archives never scans bytes before the maximum comment window.
The I/O-free PE resource tree parser moves from src/artifacts/pe to src/domain/pe and reports malformed structure, decode budgets and cancellation through the domain parse failure algebra. artifactParseFailure in src/resources maps those onto artifact reader reasons at each provider's boundary, so native no longer imports artifacts.
Fixes#11527
* refactor(domain): move the native section directory and ELF string readers into domain
* test(native): fingerprint the moved section directory in the JNI qualification script
* refactor(domain): move BinaryContainer into src/domain
BinaryContainer imports only domain modules and is shared by artifacts, firmware, gpu, go, il2cpp, python, rust and native. Living under src/native made artifacts and firmware import native for its failure types and BinaryReader. Pure move: git mv plus import specifier updates.
* refactor(firmware): move the devicetree parser into src/domain/firmware
The FIT artifact reader in src/artifacts parses embedded devicetree blobs with the parser that lived under src/firmware, while firmware's providers import src/artifacts: the two units imported each other. The parser and its fixture are pure and now sit beside domain/firmware/devicetree.ts. Pure move: git mv plus import specifier and baseline key updates.
* refactor(artifacts): break the artifacts-gpu import cycle (#11335)
* refactor(artifacts): move the LZ4 block decoder into src/artifacts
Pure move: git mv plus import specifier updates. The next commit removes its GPU-specific budget.
* refactor(artifacts): take the LZ4 output budget from the caller
decodeLz4Block bounded every decode by the GPU object budget and threw through rejectGpu, so UnityFS decoding in src/artifacts imported src/gpu while gpu imports artifacts. Callers now pass their budget: GPU payloads keep GPU_OBJECT_BYTES; UnityFS passes its 64 MiB block bound, which its size checks already enforce before decoding. Malformed blocks still throw BinaryFormatFailure with the same messages.
* test(architecture): drop the artifacts-firmware and artifacts-gpu cycles from the layer baseline
* refactor(artifacts): move the PE resource reader into src/artifacts/pe (#11347)
refactor(artifacts): move the PE resource layout and parser into src/artifacts/pe
The Node SEA and Deno standalone readers in src/artifacts locate PE resources with the layout and parser that lived under src/native/pe, while those modules already read through src/artifacts (ArtifactReaderFailure, assertArtifactReadActive). Pure move: git mv plus import specifier, baseline key and spec path updates.
Every counted-baseline change edited scripts/verify/architecture-guard-baselines.json, so PRs touching unrelated guards conflicted there. Each guard now keeps its baseline in scripts/verify/baselines/<guard-key>.json with paths sorted by code unit; --shrink-baselines rewrites, and deletes a guard's file when its last count is removed, and the guard rejects unsorted files and files that name no counted guard.