Skip to content

docs: state what the padded jp2c and unknown-box rows measure (#776) - #777

Merged
D0ubleD0uble merged 1 commit into
mainfrom
docs/resource-bounds-measured-rows
Nov 29, 2026
Merged

D0ubleD0uble merged 1 commit into
mainfrom
docs/resource-bounds-measured-rows

Conversation

@D0ubleD0uble

Copy link
Copy Markdown
Owner

Closes #776

Measured on main (30d0858) with the doc's method: release program calling decode on tests/fixtures/jp2_sycc_422_even.jp2 plus 16 MiB of boxes, peak from /usr/bin/time, held from RSS after minus before. Load 5 to 6 (1-minute), nice -n 19, -j 2. All MiB, peak / held.

Row Doc before Measured now
xml (9 B) after a jp2c holding an 8-byte box after EOC 146.5 / 86.0 105.5 / 45.0 (same as the unpadded row, 105.5 / 45.0)
xml (9 B) inside a jp2c that runs past EOC none 18.7 / 0.7
unknown (8 B) after jp2c 18.6 / 0.7 18.7 / 0.7
unknown (8 B) after a padded jp2c none 18.7 / 0.7
colr (15 B) after jp2c, unpadded and padded none 44.1 / 0.8 and 44.0 / 0.8

The 146.5 / 86.0 figure does not reproduce for 8-byte xml , uuid, unknown, or zero boxes as the box after EOC.

Code evidence:

  • A padded jp2c does make two walks: src/jp2/mod.rs:353-366 (box_longer, then walk_after_codestream_kept from the codestream end and from the box end). It costs time only (16 MiB of 8-byte unknown boxes: 0.01 s unpadded, 0.02 s padded). Records are not doubled: the first walk passes reports = !box_longer (mod.rs:356) and keeps only CHECKED boxes (src/jp2/after.rs:591, push at src/jp2/boxes.rs:663-665); the second passes checks = false (mod.rs:365) and keeps only reported boxes.
  • There is no record for each box after the codestream. A record is pushed only if reported_after (boxes.rs:319-326, push at boxes.rs:660-662) or the type is in CHECKED; an unknown box only advances kept.pos (boxes.rs:666).

Docs changed: docs/resource-bounds.md (JP2 box records text, table rows, the closing paragraph), SECURITY.md (drops "more if ... walked twice", states which boxes after the codestream get a record). The README does not cite these rows. The 8-byte Arc header on 32-bit wording is added in the five files the comment names (SECURITY.md, docs/resource-bounds.md twice, docs/incremental-decoding.md, src/incremental.rs, src/pipeline/header.rs; the last two are comments only).

Gate: fmt, clippy (all-targets and lib, -D warnings), test (2081 passed), cargo deny: all pass on stable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EhjiZ6QTR3gTC3QaD9m2QV

…e Arc header on 32-bit (#776)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhjiZ6QTR3gTC3QaD9m2QV
@D0ubleD0uble
D0ubleD0uble merged commit 3791076 into main Nov 29, 2026
15 checks passed
@D0ubleD0uble
D0ubleD0uble deleted the docs/resource-bounds-measured-rows branch November 29, 2026 22:13
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

docs: two resource-bounds.md rows describe costs that don't measure

2 participants