Share asset decoding validation and reject truncated payloads

This commit is contained in:
2026-10-14 13:08:34 +01:00
parent 418e574ac8
commit bb6f212779
7 changed files with 1024 additions and 308 deletions
+26
View File
@@ -242,6 +242,32 @@ If a scene glyph dependency cannot be resolved:
- draw/composition MUST fail as a fatal machine error with clear logging;
- runtime MUST NOT continue scene composition after the missing dependency is detected.
### 4.3 Decoding validation and physical payload completeness
Complete-buffer/reader decoding and resumable decoding MUST use the same driver
format authority for glyph layout, sound metadata and PCM conversion, and scene
headers, layers, tile ranges and decoded-size validation. Execution mode MUST NOT
change acceptance or semantic bank output for the same declared asset slice.
Every byte of the declared slice MUST be physically available. A short file read
MUST fail; it must not publish a partial sound or accept a physically complete
scene whose byte length is shorter than the declared asset size. This applies
even when the missing sound byte would have been an ignored odd PCM tail.
A physically present final unpaired PCM byte remains accepted and ignored.
The shared worker retains resumable state and reads at most 4096 payload bytes
per decode step. Scene header and layer steps read their fixed headers; tile
steps use complete tile records. PCM steps end on sample boundaries except for
the final odd tail. Save work takes priority at the next safe step. Cancellation
and target generation are checked before continuing and before staging a
complete bank; frame-boundary publication remains separate from decoding.
The conformance corpus checks explicit outputs and refusal outcomes across
buffer, reader, legacy load and resumable entry points. It covers empty supported
forms, chunk edges, palettes, truncated and trailing data, metadata, declared
sizes, scene ranges and nonfinite parallax. Ignored reserved fields remain
ignored; this validation sharing does not introduce new codecs or payload versions.
## 5 Banks and Slots
The current runtime exposes bank types: