Skip to content

Inspector fixes: luma-based maps, edge blocks, true error units - #4

Merged
thundermage117 merged 1 commit into
mainfrom
fix/inspector-bugs
Oct 10, 2026
Merged

thundermage117 merged 1 commit into
mainfrom
fix/inspector-bugs

Conversation

@thundermage117

Copy link
Copy Markdown
Owner

Stacked on #3. Review and merge #3 first; this PR then retargets to main.

Summary

Bug fixes for the block inspector and artifact inspector.

  • Edge Distortion and Blocking maps measured blue only. They read channel 0 of a BGR image, so a distortion in red or green barely registered. They now use BT.601 luma, or the single channel of 1-channel input.
  • Partial edge blocks:
  • Artifact tooltip showed a scaled value.
    • It showed the 0–255 map value after the gain was applied. It now shows the real value in pixel levels and flags saturation.
    • For the colour error map, the tooltip and heatmap read only the red channel. They now use the largest channel.
  • Error gain could drift. The WASM gain persisted between visits to the Artifact Inspector, but the slider reset to 5×. It is now re-synced on mount.
  • Phantom canvas: inspection.ts read the reconstruction from a #processedCanvas that no longer exists. It now copies the RGB view from WASM via getProcessedRgba(). This path only runs in RGB mode, which the inspector switches away from on entry, so the bug had no visible symptom.
    • suggested-blocks used the same canvas for an error score that no category used. That dead path is removed.

Test plan

  • make test: 56/56. New tests cover non-blue edge/blocking sensitivity, 1-channel input, and edge-replicated inspectBlock; the edge and blocking tests fail against the old code.
  • npm run test: 192. RGB reconstruction is read from WASM, and partial-block RGB padding is covered.
  • npm run test:browser: 44, including a real-WASM check that getProcessedRgba matches the RGB view.
  • Manual check: on a 763×507 image, navigation reaches block (95, 63) and its pixels are replicated at the edge. Tooltips read "|Error| 6.8 levels", "Edge strength Δ 7.0" and "Boundary step 23" (at x = 384, on a block boundary). No console errors.

🤖 Generated with Claude Code

- Edge Distortion and Blocking maps read channel 0 of a BGR image, i.e.
  blue only; a red/green-only distortion barely registered. They now use
  BT.601 luma (or the single channel of 1-channel input).
- Block inspector: partial right/bottom edge blocks are reachable
  (ceil instead of floor for the last block index) and padded by edge
  replication in both inspectBlock and the RGB block reader, matching
  how the codec now codes them. Previously they were unreachable and
  inspectBlock zero-filled them.
- Artifact tooltip shows the real value in pixel levels (map value
  divided by its gain) instead of the gained 0-255 map value, flags
  saturation, and reads the largest channel of the colour error map
  rather than red only (the heatmap now uses the same intensity). The
  WASM gain is re-synced on mount: it outlived the component while the
  slider reset to 5x, so map and slider could disagree.
- inspection.ts read the reconstruction from a #processedCanvas that no
  longer exists (renamed, and unmounted while inspecting). It now copies
  the RGB view from WASM via getProcessedRgba(). This path is only hit
  in RGB mode, which the inspector currently normalises away, so it had
  no visible symptom. suggested-blocks used the same canvas for an
  error score no category consumed; that dead path is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thundermage117
thundermage117 changed the base branch from feature/codec-ux-improvements to main October 10, 2026 15:13
@thundermage117
thundermage117 merged commit f97baea into main Oct 10, 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