Skip to content

refactor(build): bundle only the JPEG decoder - #5107

Merged
thymikee merged 12 commits into
0.22from
perf/0.22-jpeg-decoder-only
Nov 25, 2026
Merged

thymikee merged 12 commits into
0.22from
perf/0.22-jpeg-decoder-only

Conversation

@thymikee

@thymikee thymikee commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Bundle only the jpeg-js decoder in core and Maestro. Maestro now ships third-party notices with JPEG source attribution and Apache 2.0 text.

Value

  • Core screenshot-image JS: 20,666 → 13,781 bytes. Gzip: 8,558 → 5,583 bytes.
  • Maestro screenshot-image JS: 21,396 → 14,516 bytes. Gzip: 8,912 → 5,942 bytes.
  • Maestro's notice adds 19,505 unpacked bytes. The tarball grew by 5,916 bytes versus the decoder-only build without notices.

Validation

  • Packed core and Maestro decoded the fixture to the same pixels as upstream. Final Maestro packaging includes the notices. Independent review and hosted Coverage passed on b3a36cc4.
  • Local validation of b3a36cc4 failed on an unhandled ECONNRESET. The focused test and base unit run passed. The cause remains unproven.
  • On 954892305a, all 16 focused tests passed. Disabling the decoder adapter made the new encoder-exclusion assertion fail.
  • On 501142aadf, Fallow and 99 selector tests passed. Exact-head validation and hosted checks are pending.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.07 MB 5.06 MB -7.0 kB
Package (unpacked) 5.07 MB 5.06 MB -7.0 kB
Package (download) 1.55 MB 1.54 MB -3.0 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 16.3 ms 17.5 ms +1.2 ms
CLI --help 25.8 ms 31.2 ms +5.4 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee marked this pull request as ready for review November 25, 2026 12:54

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread tsdown.config.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 9548923. The verdict and the full list are in the summary comment.

Comment thread build/maestro/tsdown.config.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at 501142a, with no required changes.

Not blocking: these can be taken or left: normalize root once inside bundledLicenseNotices, because the trailing slash from the Maestro config means the directory walk does not stop at the repo root and can list agent-device as third-party; treat only direct children of packages as workspaces in isWorkspace, so that a non-private third-party package vendored deeper still gets attributed or fails the build; cover the core decoder wiring in a test and decode one JPEG through a built bundle, so that a removed plugin or a broken re-export fails; add THIRD_PARTY_NOTICES.txt to the required packed entries; and name the Maestro package notice path in THIRD_PARTY_NOTICES.md.

Both earlier threads can be resolved: a build-level encoder-exclusion test now exists (Maestro config only), and .fallowrc.json now names the Maestro config.

All checks pass at this commit, with Proof skipped.

Not verified here: nothing was built, packed or tested locally, so the runtime decode, the chunk byte figures and the packed tarball contents were not reproduced. The Maestro notice content was inferred from the config, the plugin code, the hosted build log size and a byte recomputation that used the undici 7.29.0 licence for 7.30.1, and the built file was not read. Execution of the two new tests in CI was inferred from the unit-core include list and a passing Coverage job.

Nothing else needs to happen on this review before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of dda736b

Since the review of 501142a: 0 new · 0 still open · 0 no longer raised

No open findings.

3 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (f1c5f3dc3ed1).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee

Copy link
Copy Markdown
Member Author

No code problems found at dda736b, and the earlier result at 501142a still holds.

Two open threads no longer apply and can be resolved. The core and Maestro bundle tests now assert that only decoder.js is bundled: #5107 (comment). The .fallowrc.json entry and export allowlist now name build/maestro/tsdown.config.ts: #5107 (comment).

All checks pass, and Proof is skipped. Coverage runs the unit-core tests, which include bundled-license-notices.test.ts. Lint, Typecheck & Package ran the packed Maestro artifact test.

Not verified here: nothing was built, packed or tested locally. That the tests fail without the fix was judged by reading the code. Execution of the two bundle tests is inferred from the unit-core include list and the passing Coverage job, because the log does not list them by name. The built notice files were not read. The string comparisons were not checked against Windows module-id separators. The size figures in the PR description were not reproduced.

Nothing else from this review needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee
thymikee merged commit f32ac10 into 0.22 Nov 25, 2026
24 of 25 checks passed
@thymikee
thymikee deleted the perf/0.22-jpeg-decoder-only branch November 25, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant