RequestSerializer: two incompatible version-21 layouts after #3988 #5132

Closed
opened 2026-10-13 12:20:20 +00:00 by Amoenus · 1 comment
Amoenus commented 2026-10-13 12:20:20 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T12:20:20Z.


Failure

Audited main a2a3a3a94de17a8ce72240ee9f22b33d87e87b1c retains two incompatible request-version-21 layouts after #3988. The original main075 writer emitted 21 without an F16 tail. The audited writer/reader still writes/max-accepts 21, but appends target.float16DenormPreserve and requires it at version >= 21. The rebase comment describes that allocation.

Independent CPU probes using copied public sources on Windows with MinGW-w64 GCC 15.2:

  • Unmodified main140: all 12 original main075 version-21 fixtures throw RequestSerializer: truncated data; all 24 current version-21 false/true requests round-trip.
  • A three-line writer/max/gate-to-22 experiment accepts those 12 historical requests and passes 24 new version-22 round-trips.
  • That experiment is incomplete: all 12 version-21 requests actually emitted by main140 with F16=true are accepted but read F16=false, because the extra tail is ignored. Both existing version-21 populations need an explicit compatibility or rejection decision.

Main a2 has the identical serializer source; the probe counts above were measured on pinned main140, not rerun on a2. The standalone minimal reproduction below was independently compiled from original a2 public sources and produced the same exact exception/exit1.

Minimal reproduction

This 374-byte synthetic request was emitted independently by the unmodified main075 serializer. No game data is included.

#include "ControlFlow/RequestSerializer.hpp"
#include <exception>
#include <iostream>

int main() {
    constexpr auto original21 = "NVNQQRUAAAAFAAADAAAAAAABAAAAAAAAAAAAgb8AAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAADAAAAAAAAAN+bVxPgrGgk776t3gABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAOQAAAAAAAAAAAAAAAAAAAAAAQEAAAEAAAAAAAAAAAAFAAAAAAAEAAAAAAAAABI0VngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAALAAAAEAAAAEAAAAAAAAF4VjQSAQEBOTAAAAA=";
    try {
        auto request = ShaderRecompiler::RequestSerializer{}.Deserialize(original21);
        std::cout << "Historical version 21 accepted\n";
    } catch (const std::exception& error) {
        std::cout << error.what() << '\n';
        return 1;
    }
}

Compile from the repository root:

g++ -std=c++20 -O2 -Icore/shader/recompiler -Icore/shader/recompiler/ControlFlow/include repro.cpp core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp -o repro
./repro

Current result: RequestSerializer: truncated data (exit 1). The historical valid request should deserialize with the absent F16 flag remaining false. Current version-21 requests contain one additional final bool; future layout versioning alone must not silently discard it.

Scope and coordination

This is capture/replay compatibility using synthetic public-source requests. No title startup/rendering failure, GPU result, or full-build validation is claimed. The F16 shader semantics from #3988 are unchanged by the experiment. #4011 is its stacked comparison optimization; #5097 separately allocates 22 for pixel.layerExported.

Proposed solution

Focused fork commit 26a6cfd keeps writer21 and accepts exactly the two emitted version-21 tails after vertexSubgroups: zero bytes means historical F16=false; one byte, 0 or 1, preserves the flag. Other lengths/values throw. Later versions retain a mandatory F16 tail. No competing version22 is allocated.

The added regression covers four independently emitted original compute/pixel/vertex/mesh contexts, their eight false/true continuations, twelve malformed cases, canonical round-trips and cache identity. The exact focused CPU test fails on unmodified main a2 with RequestSerializer: truncated data and passes with the reader change. The commit is rebased on main0f. PR #5137 now implements this compatibility repair; we will validate and review that work instead of submitting a duplicate. Our full-build campaign was stopped when the overlapping PR appeared and is not claimed complete. The fork commit remains a CPU-validated proposal, with no game-impact claim.

Both historical layouts have the same version, so a missing F16 byte necessarily denotes the original layout; there is no discriminator that could distinguish it from removal of a current request's final flag.

AI-assisted: yes.

Current-main coordination (2026-10-13)

Main e152ba8 includes #4114 and now writes/max-accepts version22 with TessellationConfiguration.patchesPerGroup. The historical version21 compatibility finding above remains scoped to its original pins. #5097's proposed layer22 allocation now overlaps canonical main22; the maintained coordination reply requests reassignment before our alpha rebase. The maintained #5137 validation reply now includes full-build and repeated synthetic/native evidence for the adapted, corrected stack on earlier main5aaa. No e152 runtime result is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5830186487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5132). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-13T12:20:20Z. --- ### Failure Audited main `a2a3a3a94de17a8ce72240ee9f22b33d87e87b1c` retains two incompatible request-version-21 layouts after #3988. The [original main075 writer](https://github.com/boykopovar/AnyPS5/blob/075169f7b3faeae1216efc35df41c44fac9f3190/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp) emitted 21 without an F16 tail. The [audited writer/reader](https://github.com/boykopovar/AnyPS5/blob/a2a3a3a94de17a8ce72240ee9f22b33d87e87b1c/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp) still writes/max-accepts 21, but appends `target.float16DenormPreserve` and requires it at `version >= 21`. The [rebase comment](https://github.com/boykopovar/AnyPS5/pull/3988#issuecomment-6143546455) describes that allocation. Independent CPU probes using copied public sources on Windows with MinGW-w64 GCC 15.2: - Unmodified main140: all 12 original main075 version-21 fixtures throw `RequestSerializer: truncated data`; all 24 current version-21 false/true requests round-trip. - A three-line writer/max/gate-to-22 experiment accepts those 12 historical requests and passes 24 new version-22 round-trips. - That experiment is incomplete: all 12 version-21 requests actually emitted by main140 with F16=true are accepted but read F16=false, because the extra tail is ignored. Both existing version-21 populations need an explicit compatibility or rejection decision. Main a2 has the identical serializer source; the probe counts above were measured on pinned main140, not rerun on a2. The standalone minimal reproduction below was independently compiled from original a2 public sources and produced the same exact exception/exit1. ### Minimal reproduction This 374-byte synthetic request was emitted independently by the unmodified main075 serializer. No game data is included. ```cpp #include "ControlFlow/RequestSerializer.hpp" #include <exception> #include <iostream> int main() { constexpr auto original21 = "NVNQQRUAAAAFAAADAAAAAAABAAAAAAAAAAAAgb8AAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAADAAAAAAAAAN+bVxPgrGgk776t3gABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAOQAAAAAAAAAAAAAAAAAAAAAAQEAAAEAAAAAAAAAAAAFAAAAAAAEAAAAAAAAABI0VngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAALAAAAEAAAAEAAAAAAAAF4VjQSAQEBOTAAAAA="; try { auto request = ShaderRecompiler::RequestSerializer{}.Deserialize(original21); std::cout << "Historical version 21 accepted\n"; } catch (const std::exception& error) { std::cout << error.what() << '\n'; return 1; } } ``` Compile from the repository root: ```sh g++ -std=c++20 -O2 -Icore/shader/recompiler -Icore/shader/recompiler/ControlFlow/include repro.cpp core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp -o repro ./repro ``` Current result: `RequestSerializer: truncated data` (exit 1). The historical valid request should deserialize with the absent F16 flag remaining false. Current version-21 requests contain one additional final bool; future layout versioning alone must not silently discard it. ### Scope and coordination This is capture/replay compatibility using synthetic public-source requests. No title startup/rendering failure, GPU result, or full-build validation is claimed. The F16 shader semantics from #3988 are unchanged by the experiment. #4011 is its stacked comparison optimization; #5097 separately allocates 22 for `pixel.layerExported`. ### Proposed solution [Focused fork commit 26a6cfd](https://github.com/Amoenus/AnyPS5/commit/26a6cfd29e93ffaac3cbc9e7547d67a4615446ac) keeps writer21 and accepts exactly the two emitted version-21 tails after `vertexSubgroups`: zero bytes means historical F16=false; one byte, 0 or 1, preserves the flag. Other lengths/values throw. Later versions retain a mandatory F16 tail. No competing version22 is allocated. The added regression covers four independently emitted original compute/pixel/vertex/mesh contexts, their eight false/true continuations, twelve malformed cases, canonical round-trips and cache identity. The exact focused CPU test fails on unmodified main a2 with `RequestSerializer: truncated data` and passes with the reader change. The commit is rebased on main0f. [PR #5137](https://github.com/boykopovar/AnyPS5/pull/5137) now implements this compatibility repair; we will validate and review that work instead of submitting a duplicate. Our full-build campaign was stopped when the overlapping PR appeared and is not claimed complete. The fork commit remains a CPU-validated proposal, with no game-impact claim. Both historical layouts have the same version, so a missing F16 byte necessarily denotes the original layout; there is no discriminator that could distinguish it from removal of a current request's final flag. AI-assisted: yes. <!-- anyps5-current-main-schema-status --> ### Current-main coordination (2026-10-13) Main `e152ba8` includes #4114 and now writes/max-accepts version22 with `TessellationConfiguration.patchesPerGroup`. The historical version21 compatibility finding above remains scoped to its original pins. #5097's proposed layer22 allocation now overlaps canonical main22; [the maintained coordination reply](https://github.com/boykopovar/AnyPS5/pull/5097#issuecomment-6146081397) requests reassignment before our alpha rebase. [The maintained #5137 validation reply](https://github.com/boykopovar/AnyPS5/pull/5137#issuecomment-6146049694) now includes full-build and repeated synthetic/native evidence for the adapted, corrected stack on earlier main5aaa. No e152 runtime result is claimed.
MarcZX10 commented 2026-10-13 12:34:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T12:34:35Z.


I opened PR #5137 for the compatibility fix. It accepts the original version-21 layout with no F16 tail as float16DenormPreserve = false, preserves the one-byte version-21 form, and continues to round-trip the version-22 flag. The registered request_serializer test covers the historical fixture and current false/true serialization. The PR depends on #5097 and preserves TideOPL’s implementation commit authorship.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6145654061 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5132#issuecomment-6145654061). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T12:34:35Z. --- I opened [PR #5137](https://github.com/boykopovar/AnyPS5/pull/5137) for the compatibility fix. It accepts the original version-21 layout with no F16 tail as `float16DenormPreserve = false`, preserves the one-byte version-21 form, and continues to round-trip the version-22 flag. The registered `request_serializer` test covers the historical fixture and current false/true serialization. The PR depends on #5097 and preserves TideOPL’s implementation commit authorship.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#5132
No description provided.