Skip to content

WEB-WORKER-PARITY: compare serialized jobs with the CPU reference (#3778) - #3782

Merged
FredApps merged 2 commits into
storytold:mainfrom
lostwald:fix/web-worker-cpu-reference
Nov 6, 2026
Merged

FredApps merged 2 commits into
storytold:mainfrom
lostwald:fix/web-worker-cpu-reference

Conversation

@lostwald

@lostwald lostwald commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Current upstream workflow status

Current head 205160df: Linux CI, SonarCloud and CodeRabbit passed. FredApps updated the branch with main using maintainer-edit permission and authorized the current-head workflows; see the maintainer update.

The earlier approval-expiration failures ran no jobs and are retained as historical context; they no longer describe the current-head workflow status. Approved by FredApps on 2026-11-06 at 15:25 UTC and merged upstream at 16:46 UTC. Earlier local validation below remains tied to its stated commits, not this maintainer-updated head.


Summary

Fixes #3778. Test-only, one file: compare a serialized Web Worker thumbnail job bit-exactly with the engine CPU reference, rather than a native job that may use an already initialized GPU. Exact pixel and histogram assertions are unchanged. The separate native window CPU/GPU equivalence test is unchanged. No production, dependency, asset or workflow changes.

Reproduction and validation

  • Reproduced independently on clean main 56d1cc28: cargo test -p lightcraft-web --lib -- --test-threads=1 gives 37 passed / 1 failed. The preceding window test initializes the GPU; default parallel ordering can pass when the thumbnail test wins the race.
  • With this fix: all 38 web tests pass both serially and in parallel, including on 56d1cc28.
  • Full cargo xtask ci passes all eight gates on this branch, based on 2e66a00d immediately before the dithering commit. Apple M2 / Metal, craft-fonts enabled; 152 external-data skips documented in the local report.
  • Important limitation: the full run on newest main 56d1cc28 passed the web tests but failed the two unrelated luminance cutoff tests that assume uniform output pixels despite new ordered dithering. Tracked separately as Dithering breaks the uniform-image assumption in two GPU luminance cutoff tests #3780; this PR does not change or suppress those tests.

Scope and self-review

Extracted from #3757 following its scope review. The CPU reference uses the original engine job source, source metadata, settings and request, so the JSON serialization round trip remains under test. No global GPU switches, tolerances or test skips were added. Reviewed and approved independently by FredApps, then merged upstream on 2026-11-06; pre-merge workflows and validation are described above.

Summary by CodeRabbit

  • Tests
    • Updated the worker rendering comparison to check its output against the engine’s CPU reference render rather than a potentially GPU-rendered result.
    • The window test continues to check equivalence between native CPU and GPU rendering. This keeps the worker comparison focused on CPU reference output while preserving the separate CPU/GPU check.

Fix storytold#3778: native thumbnail jobs can use an already initialized GPU, making exact worker serialization assertions depend on test order. Keep exact image and histogram assertions against the engine CPU pipeline. The separate native window equivalence test is unchanged.

Validation: reproduced on clean main 56d1cc2 using serial web tests (37 pass, 1 fail), then all 38 web tests pass both serially and in parallel. Full cargo xtask ci passes all eight gates on parent 2e66a00 with craft-fonts and Metal (152 external-data skips). Latest main has separate dithering/cutoff-test failures tracked as storytold#3780; no GPU disabling or assertion weakening used.

Assisted-by: OpenAI GPT-6.1 Sol
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The wire test now compares worker output with a render from the engine CPU pipeline. Its dimension, pixel-data, and histogram assertions remain unchanged.

Changes: Worker render parity

Layer / File(s) Summary
Use the engine CPU reference render
apps/lightcraft-web/src/wire.rs
The test uses the engine CPU pipeline as its reference instead of job.run(). The existing output assertions remain unchanged.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: echelon

Merge Risk: Minimal · up to 20516

The worker test now compares against the CPU reference while retaining exact assertions. No merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#3778] The thumbnail test uses the engine CPU render as its reference and retains exact dimension, pixel, and histogram assertions. The worker job still undergoes a JSON round trip. The summary repor… Provide the separate native CPU/GPU equivalence test and its documented numerical tolerance.
Passed Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the change to compare serialized worker jobs with the CPU reference.
Out of Scope Changes check Passed [#3778] The whole-PR summary reports one test-only change in apps/lightcraft-web/src/wire.rs. The diff replaces the GPU-capable native reference with the CPU reference. This change supports the link…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Out of Scope Changes check

Explanation

[#3778] The whole-PR summary reports one test-only change in apps/lightcraft-web/src/wire.rs. The diff replaces the GPU-capable native reference with the CPU reference. This change supports the linked issue. The incremental diff was unavailable, but the whole-PR summary and focused diff establish the change's scope.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Linked Issues check

Explanation

[#3778] The thumbnail test uses the engine CPU render as its reference and retains exact dimension, pixel, and histogram assertions. The worker job still undergoes a JSON round trip. The summary reports a separate native CPU/GPU equivalence test, but the file read was truncated before that test. The available evidence does not establish whether it uses the documented numerical tolerance.

Resolution

Provide the separate native CPU/GPU equivalence test and its documented numerical tolerance.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c363ba3 and 205160d.

Files selected for processing: 1

  • apps/lightcraft-web/src/wire.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@lostwald

lostwald commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Workflow status correction: approval expired, no jobs ran

The CI run and SonarCloud run for head c363ba3c originally reported action_required, but now report failure because maintainer approval expired. Both run pages show the same annotation:

This workflow run required approval but was not approved before it expired.

Neither workflow executed a job, so these failure emails do not report a failed build, test or scan. No upstream validation result was produced.

Could a maintainer restart/retrigger and approve both workflows, then review this one-file test-only fix? CodeRabbit passed with no actionable findings, but that check and the local validation documented above do not replace upstream CI or human approval. No code change is indicated by this approval-expiration failure.

nkovanen added a commit to nkovanen/lightcraft that referenced this pull request Nov 5, 2026
Merge GPU test corrections from storytold#3785 (0810bd9), including the unchanged
web worker CPU-reference prerequisite from storytold#3782 (lostwald, c363ba3).
Retain that existing wire-test oracle instead of the independently
developed equivalent. Every production file and vignette regression is
unchanged from reviewed 16c7bce. Full cargo xtask ci passed on this exact
post-merge tree before committing.

Prepared with Claude Opus 5.5 and OpenAI Codex; independently reviewed
with GPT-6.1-Sol (AI).
nkovanen pushed a commit to nkovanen/lightcraft that referenced this pull request Nov 5, 2026
Merge main 272c255, which carries storytold#3789 (GPU tests allow one level of
8-bit dither). The only conflicts were two GPU test hunks, in
equivalence.rs and mask_geometry.rs, and both take main's version
verbatim. The vignette implementation, its crop-tool and dither-phase
tests, and the storytold#3782 CPU reference in wire.rs are unchanged from
ca5b26b. Full cargo xtask ci passed on the exact merge tree before this
commit.

Prepared with Claude Opus 5.5; independently reviewed with GPT-6.1-Sol (AI).
lostwald added a commit to lostwald/lightcraft that referenced this pull request Nov 5, 2026
Restore wire.rs to upstream main, removing the unrelated render-test adjustment from the face PR diff as requested in review. The CPU-reference correction remains independently reviewable in storytold#3782; no product code or face behavior changes.

Validation: fmt, all 39 web library tests under Nextest with retries off, 48 XMP tests and five ignored-face UI tests pass. Verified wire.rs is byte-for-byte unchanged from origin/main. No full CI pass is claimed: upstream storytold#3788 and the default-runner storytold#3778 issue remain documented. Publish this face-integration scope cleanup under the contributor-authorized baseline-failure exception; no tests are removed or assertions relaxed.

Assisted-by: OpenAI GPT-6.1 Sol
lostwald added a commit to lostwald/lightcraft that referenced this pull request Nov 5, 2026
Merge main baf079f without rewriting reviewed history. Resolve only docs/gaps.md and docs/whats-new.md, retaining both upstream process V5 and persistent face-ignore entries. Keep upstream journal recovery unchanged with catalog format 12; the unrelated web CPU-reference fix remains in storytold#3782.

Validation: fmt, workspace clippy -D warnings and HEIF gate pass. All 300 catalog tests, 48 XMP tests, 19 face-engine tests and five ignored-review UI tests pass. Default-runner full workspace tests report only the independently reproduced golden storytold#3788 (unchanged post-dither hashes) and web CPU/GPU storytold#3778 failures; no green full CI claim. Apple M2 Metal and craft-fonts enabled; 157 capability/data skips disclosed. Workspace doctests and separately completed parity, layers, assets and WASM pass. Refreshed synthetic English/German batch-ignore and ignored-review screenshots inspected.

Publish this conflict resolution under the contributor-authorized exception for disclosed upstream baseline failures. No tests are suppressed, rendering behavior changed by the feature, or assertions relaxed.

Assisted-by: OpenAI GPT-6.1 Sol
@FredApps

FredApps commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Updated cleanly with current main at 205160d using the enabled maintainer-edit permission. The diff remains the CPU reference change only; exact dimensions, pixel data, histogram assertions, and the separate native window equivalence test are preserved. Formatting and diff checks pass. Approved the new current-head CI/Windows/SonarCloud workflow runs that were waiting for maintainer approval; their outcomes and local focused validation are pending. The independent dialog-font and sidebar fixture fixes remain in their own PRs.

@FredApps FredApps 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.

Reviewed current one-file diff: CPU source, metadata, settings and request remain the reference for serialization, with exact dimensions/pixel/histogram assertions preserved. The separate native window equivalence test remains intact. Exact-head upstream Linux CI passed, and all 10 wire tests passed serially on Windows/GTX1660SUPER, including the window test before thumbnail serialization. Separately, a diagnostic combination with independent #3769/#3859 fixtures passed all cargo xtask ci stages on Windows (185 declared external-data skips). That supplemental combined result does not substitute for the individual-head checks above.

@FredApps
FredApps merged commit 1b5b766 into storytold:main Nov 6, 2026
8 checks passed
AlexChambers added a commit to AlexChambers/lightcraft that referenced this pull request Nov 6, 2026
lostwald added a commit to lostwald/lightcraft that referenced this pull request Nov 7, 2026
Merge upstream main 10db03b without rebasing. Resolve only docs/gaps.md
and docs/parity-checklist.md, retaining the upstream ORF withdrawal and
all face-feature history. Face commands, catalog-13 migration, XMP policy
and face UI/regression files are unchanged from reviewed head 624d124.
The merged main includes the CPU-reference fix from storytold#3782.

Focused validation: 313 catalog tests (3 ignored), 19 face-engine tests,
48 XMP tests, 9 person-panel tests, 5 ignored-review tests, the library-switch
regression and 10 serial web-wire tests pass (405 tests total). Formatting,
workspace clippy --all-targets -D warnings, parity, layers, assets and roots
pass. All 34 locale JSON files preserve both parents' keys and values.
Earlier full-workspace evidence remains tied to 48489f1; this merge was
validated with focused checks, not a full-suite rerun.
clydecbrown referenced this pull request in emmertex/chromaforge Nov 7, 2026
Adapted from upstream #3782: wire_job_renders_like_the_engine compared the
worker's render with the native thumbnail job, which uses a GPU once
another test in the process has set one up, so Chromaforge allowed the
GPU's 3 LSB (6a97568). It now renders the job's source with the engine's
CPU pipeline and asserts the pixels and histogram are identical, whatever
the test order: an exact check of the serialized job again. Test only.

Adapted from upstream commit c363ba3cbc.

Sources: upstream #3782, commit c363ba3cbc.

Co-authored-by: lostwald <lars.ostwald@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Web worker parity test compares CPU output bit-exactly with a GPU-capable native job

2 participants