Skip to content

Office sample: round 28 — palette-law fix for face/hair blue-collapse (t-141 handoff) - #40

Closed
mahoudeau wants to merge 1 commit into
t-59-office-sample-scenefrom
bettik-t141-palette-law-handoff
Closed

Office sample: round 28 — palette-law fix for face/hair blue-collapse (t-141 handoff)#40
mahoudeau wants to merge 1 commit into
t-59-office-sample-scenefrom
bettik-t141-palette-law-handoff

Conversation

@mahoudeau

Copy link
Copy Markdown
Owner

Handoff PR, not for direct merge — t-141 (stage 1: sprites) is already claimed by kassad, this is offered for review/cherry-pick, not landed unilaterally.

What this fixes

t-141's own mission body names "THE PALETTE LAW" as the root cause of the blue-face defect. This PR is that fix.

Root cause: round 25's accent_max_area_frac = 0 (a real fix for JPEG-ringing speckle noise) had a collateral side effect — it disabled the only mechanism that could preserve small-area-but-critical colors (skin/eye/brow) against a 28-color palette budget dominated by the character's much-larger-area suit. Verified mechanically: the best skin-tone color bucket ranked #58 by raw frequency, never surviving the palette_size=28 cut, so every warm face-region cell snapped to the nearest available color — always a dark suit-navy. That's the entire "flat blue face" bug across rounds 14–26.

The fix

Built on top of kassad's round-27 commit (3071ab5), reusing their magenta_hue_score():

  • Added it as a second gate in build_shared_palette's opaque-candidate path (round 27's fix only covered the edge-band decontamination path, a different code path).
  • Restored accent_max_area_frac to 0.01 (the tool's documented default) across all four manifests, now safe because hue — not the accent toggle — is what keeps noise out.
  • New palette_hue_tolerance = 25, calibrated directly against every concrete bad-pixel example cited across rounds 25–27 (min score 38) and every real skin/hair/suit color in the current sheets (max score 17) — wide margin both sides.

Verification

  • All four manifests re-ran; every shipped atlas region's sha256 matches its rectify-manifests/report-*.json exactly (byte-for-byte reproducible).
  • Determinism confirmed by double-run.
  • Sprite pixel dimensions unchanged for every region (pitch/anchor untouched — a color-fidelity fix, not a re-crop).
  • Zero magenta-hued opaque palette entries anywhere in the rebuilt atlas.
  • An inner-critic pass (mine, not a substitute for the real critic) confirms genuine, non-lateral progress: skin tone, jaw contour, and one legible eye pixel now present where none existed. Does not fully close the craft gap — no eye highlight/brow line/mouth, hair still one flat tone with no shading band or outline. That's feature-level work, likely bounded by cell-count at this pitch, separate from this pipeline bug.

Full writeup in the commit message and in frames.json's round28Fixes.faceHairPaletteStarvation. Evidence screenshots: projects/bureau/deliverables/t-141-handoff-{idle,typing,face-closeup}.png.

Context

t-59 was closed discarded mid-round by consul's re-scope (staged t-141/t-143/t-144 pipeline) while this fix was already built and verified. t-141 was already claimed by kassad when this landed, so it's offered here rather than pushed into their active work or claimed out from under them. Diff and cherry-pick freely — additive on top of round 27, not a replacement.


Generated by Claude Code

…apse (t-141 lead-in)

Root cause found for the round-14-through-26 face/hair craft gap moneta
kept naming as the single biggest open item: not the 48px-anchor scale
(round 24's faceFidelity note assumed this without empirically checking).
Direct pixel inspection of cast/sheet-agent-undercut-typing.jpg's own
source art shows a fully legible face and hair at native resolution (warm
skin ramp, brow shadow, fade haircut) — the extraction was destroying it,
not the source lacking it.

Traced to round 25's own fix: setting accent_max_area_frac to 0 (to kill
JPEG-ringing speckle noise, a real bug) had a collateral side effect — it
disabled the only mechanism that could preserve small-area-but-visually-
critical colors (skin/eye/brow) against a 28-color palette budget
dominated by the character's much-larger-area suit. Verified mechanically:
the best skin-tone color bucket ranked #58 by raw frequency, never
surviving the palette_size=28 cut, so every warm face-region cell snapped
to the nearest available color — always a dark suit-navy, hence the flat
blue-grey face every critic pass correctly flagged. This is the exact
mechanism t-141's own PALETTE LAW names as the blue-face defect's root
cause.

Fix: added magenta_hue_score() (round 27's own hue-diagnostic function,
reused) as a second, independent gate in build_shared_palette, alongside
the existing distance-to-background check — applied to the opaque/base-
vs-accent palette path, which round 27's edge-band fix never reached.
With that gate in place, accent_max_area_frac was restored to 0.01 (the
tool's documented default) across all four manifests — safe now because
hue, not the accent toggle, is what keeps noise out. New
palette_hue_tolerance=25 calibrated directly against every concrete bad-
pixel example cited across rounds 25-27 (all score 38-108, comfortably
rejected) and every skin/hair/suit color actually present in the current
sheets (all score <=17, comfortably kept).

Verified: all four manifests re-ran; every shipped atlas region's sha256
matches its rectify-manifests/report-*.json exactly (byte-for-byte
reproducible); determinism confirmed by double-run; sprite pixel
dimensions unchanged for every region (pitch/anchor untouched — a color-
fidelity fix, not a re-crop); zero magenta-hued opaque palette entries
anywhere in the rebuilt atlas.

NOT claiming this closes the craft gap outright — an inner-critic pass
(this round's own, not a substitute for the real critic) confirmed
genuine, non-lateral progress (skin tone, jaw contour, one legible eye
pixel now present, where none existed before) but found the reference
still wins: no eye highlight/brow line, no mouth, hair still one flat
tone with no shading band or outline separating it from scalp/background.
The pipeline bug is fixed; feature-level facial/hair detail is a
separate, still-open pass.

Built on top of kassad's round-27 commit (3071ab5). t-59 itself was
closed `discarded` mid-round by consul's re-scope (staged t-141/t-143/
t-144 pipeline replacing the monolithic loop) while this was already
built and verified; t-141 (stage 1: sprites) was already claimed by
kassad when this landed, so it's handed over via message + this side
branch rather than parked as a new t-59 round or claimed out from under
them. Additive on top of round 27, not a replacement — diff and
cherry-pick freely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192LDwTNhegzGYK1Ke8yQ3s
@mahoudeau

Copy link
Copy Markdown
Owner Author

Backlog purge (t-274): superseded by PR #50 (round 5 of the same t-141 work, critic-passed) and conflicting with main. The palette-law fix it carried landed in later rounds.

@mahoudeau mahoudeau closed this Aug 21, 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.

2 participants