test(shader): cover stage-specific float modes and legacy captures #1442

Closed
ToyuAU wants to merge 2 commits from upstream-pr/1442 into main
ToyuAU commented 2026-10-08 06:42:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ToyuAU on 2026-10-08T06:42:42Z.


What

Replace the obsolete float-mode carry implementation with regression coverage for the implementation now on main through #1816. Preserve main's registered-header mode source, prepared-artifact keys, field layout and version-13 capture format.

Extract the existing stage-specific decoder into ShaderFloatMode.hpp and have RegisteredFloatMode call it. The register kind explicitly selects FP16_OVFL at bit 26 for CS, 29 for PS, 31 for GS and 30 for HS, matching the already merged #1816 implementation and its Mesa gfx10.json/gfx103.json register sources. Invalid register kinds throw. Add the decoder to the shader-cache reviewed call list.

Add the portable agc_shader_float_mode target. It covers all four RSRC1 layouts, unrelated bits, unknown versus explicit-zero modes, all eleven control fields across eight shader stages, cache/source-memo/prepared-interface identities, round trips and invalid capture rejection. Genuine version-12 and version-13 fixtures are generated using unchanged serializers from 04477932 and f1451396, respectively. Version 12 remains unknown; version 13 preserves its recorded mode and other versioned fields.

This change does not reintroduce a second float-mode type, a second serialization bump, live queue-register overrides, or new instruction semantics. Linked-stage mode semantics and run-time RSRC1 changes remain separate work.

Tested

macOS arm64, AppleClang 17, C++20:

  • Windows CI caught an interface macro collision in a local test variable. The variable is renamed; the portable harness also passes with -Dinterface=struct, warnings-as-errors and sanitizers. Full Windows CI passed on the prior head 5c8ada88; fresh Linux/Windows CI is pending after the rebase.
  • The new test passes with -Wall -Wextra -Werror and AddressSanitizer/UndefinedBehaviorSanitizer.
  • A mutation that reads pixel FP16_OVFL from bit 26 instead of bit 29 fails the new stage-specific assertion.
  • A portable CMake/Ninja harness using the actual new target definition configures, builds and passes its CTest registration. The harness supplies an interface libc target and does not constitute a full driver build.
  • The actual ShaderCacheVersion.cmake source/include/call guard passes against the worktree's source and reviewed call list.
  • Documentation checker: zero errors. Committed diff whitespace check passes.

Historical GitHub Actions Build run 37873090443 passed on the prior head 5c8ada88: full Linux/Windows builds, patched libs and CTest. The new agc_shader_float_mode test passes on both platforms. Windows: 489 registered tests, 286 passed and 203 skipped. Linux: 498 registered tests, 473 passed and 25 skipped; GPU execution uses the CI software Vulkan driver.

Rebased onto main 6cc0503d at head 6e7e99cc. The TechnicalDebt.md conflict retains main's updated f32/f16 NaN status and the new decoder-test note. The portable CMake/CTest harness passes again with warnings-as-errors, AddressSanitizer/UndefinedBehaviorSanitizer and -Dinterface=struct; documentation, conventions and committed diff whitespace checks pass. Fresh native Linux/Windows CI is pending on this rebased head.

Full supported Linux/Windows builds, patched libs, existing driver/cache suites and GPU/title execution remain untested locally. Physical-hardware/title validation remains outstanding; Windows GPU tests were skipped in CI. Conventions pass against the published shader head and this PR title/body. No hardware or playability result is claimed.

Checklist

  • Based on current main 6cc0503d; #1816 implementation reused
  • One topic: stage-specific float-mode decoding and regression coverage
  • No added code comments, dependencies, exports or title exceptions
  • Existing request/capture format and prepared mode source preserved
  • Depends on: none; #1816 has merged
  • AI-assisted: yes (OpenAI Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4782913650 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1442). Originally posted by [ToyuAU](https://github.com/ToyuAU) on 2026-10-08T06:42:42Z. --- ### What Replace the obsolete float-mode carry implementation with regression coverage for the implementation now on main through #1816. Preserve main's registered-header mode source, prepared-artifact keys, field layout and version-13 capture format. Extract the existing stage-specific decoder into ShaderFloatMode.hpp and have RegisteredFloatMode call it. The register kind explicitly selects FP16_OVFL at bit 26 for CS, 29 for PS, 31 for GS and 30 for HS, matching the already merged #1816 implementation and its Mesa gfx10.json/gfx103.json register sources. Invalid register kinds throw. Add the decoder to the shader-cache reviewed call list. Add the portable agc_shader_float_mode target. It covers all four RSRC1 layouts, unrelated bits, unknown versus explicit-zero modes, all eleven control fields across eight shader stages, cache/source-memo/prepared-interface identities, round trips and invalid capture rejection. Genuine version-12 and version-13 fixtures are generated using unchanged serializers from 04477932 and f1451396, respectively. Version 12 remains unknown; version 13 preserves its recorded mode and other versioned fields. This change does not reintroduce a second float-mode type, a second serialization bump, live queue-register overrides, or new instruction semantics. Linked-stage mode semantics and run-time RSRC1 changes remain separate work. ### Tested macOS arm64, AppleClang 17, C++20: - Windows CI caught an `interface` macro collision in a local test variable. The variable is renamed; the portable harness also passes with `-Dinterface=struct`, warnings-as-errors and sanitizers. Full Windows CI passed on the prior head 5c8ada88; fresh Linux/Windows CI is pending after the rebase. - The new test passes with -Wall -Wextra -Werror and AddressSanitizer/UndefinedBehaviorSanitizer. - A mutation that reads pixel FP16_OVFL from bit 26 instead of bit 29 fails the new stage-specific assertion. - A portable CMake/Ninja harness using the actual new target definition configures, builds and passes its CTest registration. The harness supplies an interface libc target and does not constitute a full driver build. - The actual ShaderCacheVersion.cmake source/include/call guard passes against the worktree's source and reviewed call list. - Documentation checker: zero errors. Committed diff whitespace check passes. Historical GitHub Actions Build run [37873090443](https://github.com/boykopovar/AnyPS5/actions/runs/37873090443) passed on the prior head 5c8ada88: full Linux/Windows builds, patched libs and CTest. The new agc_shader_float_mode test passes on both platforms. Windows: 489 registered tests, 286 passed and 203 skipped. Linux: 498 registered tests, 473 passed and 25 skipped; GPU execution uses the CI software Vulkan driver. Rebased onto main 6cc0503d at head 6e7e99cc. The TechnicalDebt.md conflict retains main's updated f32/f16 NaN status and the new decoder-test note. The portable CMake/CTest harness passes again with warnings-as-errors, AddressSanitizer/UndefinedBehaviorSanitizer and `-Dinterface=struct`; documentation, conventions and committed diff whitespace checks pass. Fresh native Linux/Windows CI is pending on this rebased head. Full supported Linux/Windows builds, patched libs, existing driver/cache suites and GPU/title execution remain untested locally. Physical-hardware/title validation remains outstanding; Windows GPU tests were skipped in CI. Conventions pass against the published shader head and this PR title/body. No hardware or playability result is claimed. ### Checklist - [x] Based on current main 6cc0503d; #1816 implementation reused - [x] One topic: stage-specific float-mode decoding and regression coverage - [x] No added code comments, dependencies, exports or title exceptions - [x] Existing request/capture format and prepared mode source preserved - [x] Depends on: none; #1816 has merged - [x] AI-assisted: yes (OpenAI Codex)
adriadam10 commented 2026-10-08 13:47:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:47:22Z.

Review: CHANGES_REQUESTED


Thanks, the key/capture plumbing looks right (the 0x10a fix, the allowlist entry and the TechnicalDebt row are all fine). It conflicts with main, and the conflict isn't just textual:

  • RequestSerializer.cpp: main is at serialization version 12 (scratchDwords 10, orderedPixelShader 11, narrowSubgroupClock 12). This PR writes 10 and reads under version >= 10u. Rebase and use the next free version, 13 unless main has moved again; the > N limit and the TechnicalDebt sentence "Captures before version 10…" change with it.
  • tests/ShaderFloatMode.cpp:52: the "legacy" fixture is a version-9 capture. Regenerate it with the unchanged serializer from current main (version 12) and keep asserting that its mode is unknown. The truncated-capture prefix at :100 and the NVNQQQ… prefixes in tests/ShaderMemory.cpp (:759, :764) need the new number too.
  • Before picking the number, grep the open PRs for the same bump (#1492, #1485, #1190, #1077 also touch the serializer); whichever merges second has to move up.
  • The branch has no CI run on its head yet; please push the rebased branch so the Linux and Windows jobs run.

Happy to look again once it's rebased.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5457591055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1442#pullrequestreview-5457591055). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T13:47:22Z. **Review:** CHANGES_REQUESTED --- Thanks, the key/capture plumbing looks right (the `0x10a` fix, the allowlist entry and the TechnicalDebt row are all fine). It conflicts with `main`, and the conflict isn't just textual: - `RequestSerializer.cpp`: `main` is at serialization version 12 (`scratchDwords` 10, `orderedPixelShader` 11, `narrowSubgroupClock` 12). This PR writes 10 and reads under `version >= 10u`. Rebase and use the next free version, 13 unless `main` has moved again; the `> N` limit and the TechnicalDebt sentence "Captures before version 10…" change with it. - `tests/ShaderFloatMode.cpp:52`: the "legacy" fixture is a version-9 capture. Regenerate it with the unchanged serializer from current `main` (version 12) and keep asserting that its mode is unknown. The truncated-capture prefix at `:100` and the `NVNQQQ…` prefixes in `tests/ShaderMemory.cpp` (`:759`, `:764`) need the new number too. - Before picking the number, grep the open PRs for the same bump (#1492, #1485, #1190, #1077 also touch the serializer); whichever merges second has to move up. - The branch has no CI run on its head yet; please push the rebased branch so the Linux and Windows jobs run. Happy to look again once it's rebased.
popcoder565 commented 2026-10-09 15:22:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:22:42Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 6e7e99cc, merged onto main d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run.

  • This PR's tests pass: agc_shader_float_mode. None of them reported skipping a case.
  • Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows PATH setup.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083877663 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1442#issuecomment-6083877663). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:22:42Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `6e7e99cc`, merged onto `main` d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run. - This PR's tests pass: `agc_shader_float_mode`. None of them reported skipping a case. - Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows `PATH` setup. No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
oneandonlydean commented 2026-10-09 20:08:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:08:02Z.


Closing: #1816 already decodes the stage-specific bits on main, and these tests pass on main as well, so they don't pin a change. If one of those bits turns out wrong, a fix with a test that fails on main is welcome.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088413331 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1442#issuecomment-6088413331). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:08:02Z. --- Closing: #1816 already decodes the stage-specific bits on main, and these tests pass on main as well, so they don't pin a change. If one of those bits turns out wrong, a fix with a test that fails on main is welcome.

Pull request closed

Sign in to join this conversation.
No reviewers
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!1442
No description provided.