--- id: PLN-0091 ticket: variable-tile-bank-palette-serialization title: Variable Glyph Palette Tests, Fixtures, and Final Validation status: done created: 2026-07-14 completed: 2026-07-14 ref_decisions: - DEC-0038 tags: - tests - fixtures - validation - glyph-bank - palette-serialization --- ## Objective Update tests and fixtures to prove Studio/packer emit runtime-conforming variable glyph palette payloads and contain no stale fixed-padding assumptions. ## Background `DEC-0038` requires downstream fixture coverage for `palette_count = 1`, an intermediate count, and `palette_count = 64`, plus producer validation for metadata/payload mismatch. Earlier tests still assert `palette_count = 64`, 4096-byte palette blocks, and fixed glyph payload sizes. ## Scope ### Included - Update packer unit tests and integration-style workspace tests. - Update packer fixture `asset.json` files and expected runtime payload checks. - Update Studio tests only where Studio projections or UI logic expose effective palette count. - Run focused and broad validation. ### Excluded - Runtime repository tests. - New feature design. - Palette remapping behavior. ## Execution Steps ### Step 1 - Update packer parser and metadata tests **What:** Prove effective `palette_count` validation. **How:** Add tests for `palette_count = 1`, intermediate counts, `64`, duplicate/sparse direct identity behavior, and rejection above `64`. **File(s):** - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/services/PackerAssetDeclarationParserTest.java` - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/repositories/PackerGlyphBankWalkerTest.java` ### Step 2 - Update payload and asset table tests **What:** Prove variable payload lengths and size formulas. **How:** Replace fixed 4096-byte expectations with `palette_count * 16 * 4`. Assert `size`, `decoded_size`, payload offsets, and RGBA bytes for several counts. **File(s):** - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/services/FileSystemPackerWorkspaceServiceTest.java` - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/repositories/PackerRuntimeAssetMaterializerTest.java` - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/services/PackerRuntimePatchServiceTest.java` - `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/services/PackerRuntimeRegistryTest.java` ### Step 3 - Update fixtures **What:** Replace stale fixed-padding fixtures. **How:** Regenerate or edit packer test fixtures so at least one glyph bank uses `palette_count = 1`, one uses an intermediate count, and one uses `64`. Fixtures with fixed 64 padding are valid only when metadata says `palette_count = 64`. **File(s):** - `prometeu-packer/prometeu-packer-v1/src/test/resources/fixtures/**/asset.json` - Related binary or generated expected payload fixtures under packer test resources. ### Step 4 - Update Studio tests **What:** Cover Studio-facing projection changes. **How:** Adjust tests only where Studio surfaces effective palette counts or metadata. Keep color rendering assertions focused on `rgba8888`. **File(s):** - `prometeu-studio/src/test/java/p/studio/workspaces/assets/details/**` ### Step 5 - Run validation and residue scans **What:** Prove no normal-path fixed-padding residue remains. **How:** Run relevant Gradle tests and search normal specs/code/tests/fixtures for stale `palette_count = 64`, `4096`, fixed `64 * 16 * 4`, `GLYPH/indexed_v2`, and sparse remapping language. Classify any remaining match as historical, max-bound, or a bug. **File(s):** - `docs/specs/packer/**` - `docs/specs/studio/**` - `prometeu-packer/**` - `prometeu-studio/**` ## Test Requirements ### Unit Tests - Packer parser, walker, materializer, details/read, and workspace service tests pass. - Studio asset details tests pass where touched. ### Integration Tests - Packer workspace build/materialization tests pass. - Repository build or narrow Studio/packer build validation passes. ### Manual Verification - Residue scan finds no normal-path fixed-padding contract text or code. - `discussion validate` passes. ## Acceptance Criteria - [x] Tests cover `palette_count = 1`, an intermediate count, and `64`. - [x] Tests cover variable `size` and `decoded_size`. - [x] Tests cover emitted palette byte length and RGBA order. - [x] Tests cover metadata/payload mismatch rejection or producer validation. - [x] Fixtures no longer rely on fixed 64-palette padding unless count is `64`. - [x] Validation commands pass. - [x] Residue scan results are clean or explicitly classified. ## Execution Notes - Added packer workspace coverage for `palette_count = 1` and intermediate `palette_count = 7`. - Existing fixture and build paths continue to cover `palette_count = 64` where a max-count payload is intended. - Added parser coverage rejecting palette declaration index `64`, preserving the v1 maximum effective count of `64` through direct ids `0..63`. - `:prometeu-packer:prometeu-packer-v1:test` passed. - `./gradlew build` passed. - Residue scan found only intentional normative statements rejecting `convertedRgb565`, `GLYPH/indexed_v2`, fixed-padding compatibility, and sparse-to-dense remapping. ## Dependencies - Depends on `PLN-0087`, `PLN-0088`, `PLN-0089`, and `PLN-0090`. ## Risks - Generated project fixtures may require regeneration rather than manual edits. - Broad residue scans may include historical discussions; scope final checks to active specs, code, tests, and fixtures.