fix(agc): reject unmeasured single-sample dithered alpha-to-coverage #10581
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10581"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ashwin280802 on 2026-10-24T11:12:21Z.
What
Reject unmeasured single-sample dithered alpha-to-coverage in the AGC Driver (
DecodeStateandDrawRejection) forDB_ALPHA_TO_MASK0xe701 and 0x18701, verify rejection in tests, and document technical debt.DecodeStateandDrawRejection(requires eight matched raster/DB_EQAA samplesfor0x18701andrequires two matched raster/DB_EQAA samplesfor0xe701), rejecting single-sample targets until the spatial repetition period and dither behavior are measured on PS5 silicon.core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, add tests verifying that single-sample draws with0xe701and0x18701are explicitly rejected by bothDecodeStateandDrawRejection.docs/dev/debt/libSceAgcDriver.mdexplaining why single-sample dithered coverage remains unsupported/rejected and recording the preliminary quad-granular RADV observations.Tested
ctest --test-dir build-full -R "^agc_driver_graphics$" -Vpassed 1/1 (100%).agc_driver_graphicstest on Windows 11 with NVIDIA GeForce RTX 5070 withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.VK_LAYER_KHRONOS_validationloaded cleanly (no missing-layer warning); verified 0VUID-validation errors introduced.python tools/check_conventions.py --base origin/mainpassed cleanly with 0 violations.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:25:19Z.
Review: CHANGES_REQUESTED
The two-sample dither path is consistently carried through decode state, draw keys, request serialization, and the shader table; the focused graphics tests and Bugsnax report provide useful evidence. One checklist item needs correction before I can approve:
Unblocks: PPSA01503 #9900points to no issue or pull request in this repository (the GitHub API returned 404 for both endpoints when checked). Please replace it with the correct bring-up discussion ornone. Hosted conventions, intake, and labels pass; the hosted product build jobs were not present in this PR check set. I did not run the graphics/GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:40:12Z.
Review: APPROVED
The checklist now links the correct Bugsnax bring-up discussion (#9900), which I verified exists and matches PPSA01503. The implementation review remains unchanged: the two-sample alpha-to-coverage path is carried consistently through decode state, draw keys, request serialization, and shader sample-mask selection. The author added a same-machine Vulkan validation comparison against main and reports 0 VUID errors on both runs. Hosted conventions, intake, and labels pass; this PR check set does not include hosted product builds. I did not run the GPU test locally.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T12:34:42Z.
Review: CHANGES_REQUESTED
The implementation review remains positive: the single-sample bypass is threaded through the draw state and serialization, and the PR reports a same-GPU validation comparison against its stated base. A merge-blocking branch issue has appeared since that review: GitHub currently reports this PR as
CONFLICTING/DIRTYagainstmain. Its head is still based on the older #10515 headf179568345cd…, while #10515 now points tobb2e64983cf9…. Please rebase this stack on the current #10515 head (or current main after #10515 merges), resolve the conflict, and rerun the focused graphics validation comparison on the resulting head. The existing validation results are for basefa515def85and the prior head; they do not establish results for a rebased tree. Product CI jobs are absent from the current check set.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T22:33:37Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
5cfbcec53b70aa7b6d27cfcc21c40cc33d3e27f2with the new native Vulkan result posted in the discussion. That test uses a one-sample attachment and changes onlyalphaToCoverageEnable; on RX 6650 XT/RADV, alpha-to-coverage changes the written-pixel count for alpha 0.25, 0.5 and 0.75. The current description says Vulkan Section 28.8.2 strictly disables this operation at one sample, but the cited rule does not state that, and the measured result contradicts it.The game reproduction and register capture establish that this title reaches the state and that the current rejection blocks it; they do not yet establish what the PS5 does with stale
DB_ALPHA_TO_MASKwhenMSAA_ENABLEis clear. Please remove the unsupported Vulkan-spec claim and provide PS5/hardware-oracle evidence for the disabled behavior, or keep the alpha-to-coverage state modeled and address the title path using measured console semantics. The current branch also remainsDIRTYagainst its #10515 base, so the focused validation needs to be rerun after the required rebase. I did not run GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-27T10:40:27Z.
Review: CHANGES_REQUESTED
Thanks for the rebase and for dropping the Vulkan one-sample claim. One blocker remains:
State.cpp:1530,State.cpp:2388-2404:0xe701/0x18701on a one-sample target now decodes as the undithered model, and the dither-specific checks (sample count, locations, FP16/32 export) are skipped. The new debt entry indocs/dev/debt/libSceAgcDriver.mdsays the hardware does dither one-sample coverage across 2x2 quads, so the draw is accepted with a coverage that differs from the console's for every alpha strictly between 0 and 1. That is a plausible-but-wrong result wheremainthrew. Either measure the one-sample dithered mask (a RADV default-dither render on a one-sample target gives the per-quad pattern, as was done for the eight- and two-sample tables) and model it, or keep throwing for this case.tests/Graphics.cpp:4992-5005: the new test only checks the decoded flags and thatDrawRejectionis empty. Nothing pins the coverage a one-sample0xe701draw produces, so it cannot catch the difference above. Add an execution case in the style ofAlphaToCoverage.cppwith alphas such as 0.25, 0.5, 0.75 per quad position, with expected values from the measurement.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T08:14:38Z.
Review: CHANGES_REQUESTED
Thanks for the table and the execution test. The model still doesn't match the measurement it is based on:
SpirvModuleEmitter.cpp:510-512,tests/execution/AlphaToCoverage.cpp:527-540:oneSampleMasksandOneSampleDitherCasesgive one covered pixel per 2x2 quad at alpha 0.25 ({1,0,0,0}) and a diagonal pair at 0.5. The RADV readback in your tarball (run-1.jsonl, 4x4 target) shows something else: alpha 0.25 writes only the upper-left 2x2 block, 0.5 writes the upper-left and lower-right blocks, 0.75 all but the lower-left. That is a quad-granular pattern (all four pixels of a quad share the result), not a per-pixel Bayer pattern inside each quad. As written, the draw is accepted with coverage that differs from the measurement for every alpha strictly between 0 and 1.alphaToCoverageEnableon RADV (RX 6650 XT). Please say that in the debt entry and the PR, and keep the caveat that it is notDB_ALPHA_TO_MASK0xe701 / 0x18701 withMSAA_ENABLEclear on PS5.docs/dev/debt/libSceAgcDriver.md:47: also states the "8-level per-quad Bayer" model; update it with whatever the larger readback shows.main; please rebase and make sure the full Build is green on the new head (the Bugsnax run was Windows/RTX 5070 only).The four-sample
0x1e701draw @edubox reports is a separate follow-up, agreed.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T14:38:55Z.
Review: CHANGES_REQUESTED
Thanks for the rebase and the debt entry wording. The main point is still open:
SpirvModuleEmitter.cpp:521-523andtests/execution/AlphaToCoverage.cpp:585-598:oneSampleMasks/OneSampleDitherCasesare unchanged, so alpha 0.25 still covers one pixel per 2x2 quad ({1,0,0,0}) and 0.5 a diagonal pair. The RADV readback inrun-1.jsonlis quad-granular (0.25 writes only the upper-left 2x2 block, 0.5 the upper-left and lower-right blocks), so the draw is accepted with coverage that differs from the measurement for every alpha strictly between 0 and 1, and the test pins that same model.docs/dev/debt/libSceAgcDriver.md:48(which still describes the 0xe701/0x18701 paths without the one-sample case) and the new entry at:49with the period found.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:11:15Z.
Review: CHANGES_REQUESTED
Reviewing exact head
05082c049563be230b150b6a714824d55ed5da0b.What I ran
Results
Findings
Blocking
The current
oneSampleMaskstable andOneSampleDitherCasestest encode one covered pixel per 2x2 quad at alpha 0.25 and a diagonal pair at 0.5. The posted RADV readback describes quad-granular coverage instead: alpha 0.25 writes the upper-left 2x2 block, and 0.5 writes the upper-left and lower-right blocks. The current table therefore conflicts with the available measurement, and the 4x4 test only confirms the implementation's own assumed pattern. The separate Vulkan validation run checks API validity, not this rendering behavior.Please either derive the pattern from a larger 16x16 or 32x32 readback (with 1/8 alpha steps and both FP16 and 32-bit exports) and update the table and tests, or keep the single-sample dithered path rejected until the behavior is measured. The current README/debt entry should continue to distinguish modeled behavior from PS5 silicon behavior.
Non-blocking
Sources
Not verified
To get this to a good state
Post a larger measurement-derived table and matching regression, or remove the unsupported single-sample table and retain the explicit rejection; then request a re-review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T17:03:22Z.
Review: APPROVED
Re-checked — new head, looks good
The current diff adds regression coverage for the existing rejection of unmeasured single-sample dithered alpha-to-coverage and documents the remaining measurement debt.
What I ran
Reviewed exact head
4bb5aa9f0e39858a6295c31cef199f8f164e25eaagainst basebb04a4f1ea0175e9e4f149f0359a764d62ff3296(main). GitHub reports the PR mergeable with a clean merge state; I did not create a local merge preview. Environment: Debian 12, GCC 12.2.0, host Intel Xeon E5-1620 v2; the focused test binary ran under QEMU user mode with a Haswell CPU model.I ran the focused state command and build on both the PR head and base. The Vulkan CTest command above was run on the PR head; the full binary was also attempted under QEMU on both revisions. GitHub checks were read for the exact PR head, and the Windows validation result below is author-reported.
Results
agc_driver_graphics_testsbuildgit diff --checkVUID-errorsUnedited command output
Focused alpha-to-coverage command, PR head:
Full CTest command, PR head:
Full graphics QEMU run, PR head:
Full graphics QEMU run, base:
Hosted check output:
Negative control
0xe701and0x18701on a single-sample target are rejected by bothDecodeStateandDrawRejectionFindings
Blocking
None found in the current diff.
Non-blocking
The exact-head Windows Vulkan result is author-reported, and the local full graphics run could not complete under this host/QEMU setup. The PR keeps the unmeasured hardware behavior explicitly unsupported and recorded as debt.
Sources
State.cpp, pinned to this headNot verified
VUID-comparison. The host CPU and QEMU user-mode memory limitations prevented that. The current-head Windows run is author-reported.To get this to a good state
No blocking follow-up is needed for this change. Keep the debt entry until the spatial repetition and console behavior are measured; if the head changes, I will rerun the focused tests and relevant validation checks on the new head.