Skip to content

perf(integrity): bound logo alts per control, free window arrays before the reads #1424 - #1469

Closed
nc9 wants to merge 6 commits into
mainfrom
fix/integrity-logo-alt-cap
Closed

nc9 wants to merge 6 commits into
mainfrom
fix/integrity-logo-alt-cap

Conversation

@nc9

@nc9 nc9 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1424. Depends on #1466: rebased on main v0.0.153 and on #1466's reworked branch; it contains its commits, so merge #1466 first and rebase (the diff then shrinks to one commit). Not stacked on the branch, so it is not closed when #1466 merges.

The two follow-ups from the #1455 review:

  • Logo alts per control. Since fix(integrity): scan long control label windows #1424 #1454 the alt of every logo in a control went to the window pass in full. A control keeps the first 4 alts in full, the next ones for their first 300 characters (the old cut), and at most 100 alts in all; past that the control is counted in controlsUnread. A later alt (5th or beyond) longer than 300 characters also counts the control as not read in full, so the cut is never silent (fixed after review: the first version only counted past 100). A control wrapping 100,000 images (5.1 MB): 361 ms and 67 MB RSS before, 270 ms and 23 MB in my single run; the reviewer measured 100,000 controls at 536 MB peak before and 435 MB after with no clear wall-time gain, so read it as a modest memory saving, not a speed-up.
  • Free the window arrays (gathered, wanted, served) and the alt map as soon as the budget pass has built the prepared controls, before the reads.

Tests (integrity-evasions-784.test.ts, 38): the phrase in the 3rd alt padded past 300 characters is found; the same padded alt as the 20th logo is read only at its start (not found, no error) while an unpadded phrase in the 20th alt is found; 300 logos in one control reports controlsUnread: 1. Integrity suites pass (the 300 x 16 KB U+FDFA runner test sits near the 2 s budget and failed once in a full-file run under load, then passed alone three times; the same test is on main).

Docs and CHANGELOG (the #1458-#1460 bullet) updated. Skill change: none.

nik

Known, pre-existing and not changed here: controlsUnread can double count a control whose attribute cut and window cut both fire (paddedAttributes vs the per-attribute cut); to be filed as its own issue.

@nc9
nc9 force-pushed the fix/integrity-logo-alt-cap branch from 4ffe7c4 to 6e1d290 Compare November 1, 2026 01:47
nc9 added 6 commits November 1, 2026 13:45
…n four files that fit a lane watchdog #1465

Signed-off-by: Nik Cubrilovic <[email protected]>
…sit budget with the clock off; drop an unused import #1465

Signed-off-by: Nik Cubrilovic <[email protected]>
…r control, no-cue controls served first in the shared half, one auth cue list #1458 #1459 #1460

Signed-off-by: Nik Cubrilovic <[email protected]>
…ide the budgets, with its cost #1459

Signed-off-by: Nik Cubrilovic <[email protected]>
…n full; honest memory note #1424

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.155 as 8d494b80, 5bf19ea2 via #1503.

nik

@nc9 nc9 closed this Nov 1, 2026
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.

1 participant