feat(agc): draw EQAA color targets at their coverage sample count #9700

Merged
frankea merged 16 commits from upstream-pr/9700 into main 2026-11-04 03:57:56 +00:00
frankea commented 2026-10-22 08:56:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-22T08:56:48Z.


What

DecodeColorBuffer refused every color target whose CB_COLOR_ATTRIB.NUM_FRAGMENTS is below NUM_SAMPLES (EQAA): "color targets with fewer fragments than samples (EQAA) are unsupported". This accepts such a target when it has FMASK (CB_COLOR_INFO.COMPRESSION and a CB_COLOR*_FMASK base) and no DCC, and draws it as the existing host multisampled target at its coverage sample count.

  • ColorTarget gains eqaaFragments (0 when the fragments equal the samples). The FMASK base is #7948's fmaskAddress, which main decodes for every multisampled target; CB_COLOR*_FMASK_BASE_EXT (context 0x3a0 + slot) is now in DrawKeyRegisters. samples stays NUM_SAMPLES, as main's coverageSamples is, so pipelines, draws, CMASK fast clears, the FMASK decompress and the CB resolve are the existing MSAA path. eqaaFragments fits in existing padding, so sizeof(State) and the pipeline journal are unchanged; a pipeline depends on the coverage sample count, not the fragment count.
  • The guest footprint (MultisampledColorBytes, the guarded range, color fills) uses the fragment count, as addrlib sizes the surface: a 4-sample 2-fragment 512x512 RGBA8 target occupies 2 MiB, not 4.
  • The FMASK plane is guarded as a Z_64KB_X surface of 1, 2 or 4 bytes per pixel, so a T#, CPU or DMA read of it throws by name ("overlaps the FMASK of EQAA color target") instead of reading memory the host never wrote. An unmap or allocation removal of either plane retires all of the target's guards; the second pass of retireUnmapped now drops every inactive range, not only metadata ranges.
  • The FMASK guard follows the FMASK base. When a resident EQAA target is drawn again with another CB_COLOR*_FMASK base, acquire() replaces its FMASK guard with one at the new base and keeps the target and its samples. The target's identity stays surface, format, extent, samples and fragments, so its contents carry over. The move bumps main's guarded-range generation (#6628), as every other guard change does.
  • With #8223 in main, the FMASK range shares the target's TargetUse: a bind of another target over it claims the target, and a CPU write over it after the target's last use retires it, as for the color plane. Each use stamp first collects the FMASK plane's writes (3e3ddc10c), so CPU writes made before the draw do not count as overwrites.
  • Sampling an EQAA target through a T# and storage image access to it throw ("... EQAA color target ... is not implemented"). EQAA without FMASK, with DCC, or with more fragments than samples throws. A one-fragment target takes #9450's path on main (one sample, samples 1 and coverageSamples NUM_SAMPLES, FMASK guarded); coverageSamples stays the sample count for this PR's targets too, so #9450's one-fragment checks see them as ordinary N-sample targets.
  • Technical debt: a new "EQAA color targets" entry, which also says the guest-access guard sizes the color plane by fragments; "Multisampled color targets" names the FMASK range. "Multisampled target guest access" is unchanged from main.

GPU semantics, with sources:

  • NUM_SAMPLES is the coverage sample count and NUM_FRAGMENTS the number of colors stored per pixel. PAL and Mesa program them that way: PAL gfx9ColorTargetView.cpp and Mesa ac_descriptors.c.
  • addrlib sizes the color surface by its fragments: ac_surface.c, with the block rule the "Multisampled target guest access" debt entry already cites.
  • FMASK holds, per sample, the fragment it uses or "unknown" (Mesa ac_descriptors.h). Its element is 1 byte for 4 samples and 2 fragments, and 1, 2 or 4 bytes across the other counts (ac_descriptors.c).
  • The host keeps a color per coverage sample, which equals the console wherever a pixel needs at most NUM_FRAGMENTS distinct colors. Where more primitives meet in a pixel, the console marks samples unknown and the CB resolve drops them (radeonsi si_state.c). Which samples it drops is not documented or measured, so a resolve here can differ at those pixels. The debt entry says so.
  • One fragment behaves differently, which is why it takes #9450's path instead. @fma-rc's radeonsi measurements in #9450 (GL_AMD_framebuffer_multisample_advanced, RDNA2) show the split: with 2 or 4 storage samples, draws that cover part of a pixel resolve to blends, as a host color per sample does; with 1 storage sample only what sample 0 covers survives.

Why: Gran Turismo 7 (PPSA01317) stops on this refusal when it loads the World Map and when it delivers a purchased car, at a 512x512 RGBA8 target with 4 samples and 2 fragments (CB_COLOR_INFO 0x0000e028, CB_COLOR_ATTRIB 0x0000a000, CMASK and FMASK). The title consumes the target only through a CB resolve.

Overlap with other PRs:

  • #7948 (merged) serves FMASK T# reads of tracked 8-sample DCC targets. An EQAA target has no DCC, so a T# read of its FMASK still throws.
  • #8429 (merged) decodes FMASK T# reads from guest memory, FMASK8_S4_F2 included. With this PR, such a read of a host EQAA target's FMASK throws through the guard until the driver serves FMASK from the host target, as #7948 does for 8-fragment targets.
  • #9450 (merged) draws a 4-sample 1-fragment target as one sample with sample 0's coverage and guards its FMASK range. With main merged in, the two cover disjoint fragment counts in one decode: one fragment takes #9450's branch, two or more below the samples this PR's. #9450's FMASK ranges and this PR's are separate guard kinds with their own messages.
  • #10049 (mine) retires a multisampled target that a write-only storage store overwrites. Its color-plane test (!metadataValid && !fmask) would also match this PR's EQAA FMASK range, so whichever lands second keeps that range out of the test. The two also conflict in the libSceAgcDriver debt file.
  • #9533, with #9717 and #9742 stacked on it, moves the guarded byte count into guardedColorBytes(target), as @EagleBearerYS noted. main now has that function from #8223, and this PR takes the fragment count there.
  • No open PR accepts more than one but fewer NUM_FRAGMENTS than NUM_SAMPLES in DecodeColorBuffer.

Tested

  • Refreshed onto main ee9a9a66c (47d9c5125; #8223's guard rework resolved as described in the comments), fixed in 3e3ddc10c, and refreshed onto main b1b5353cf (head 9465e32e3; #6628), RTX 4090 (NVIDIA 616.92, Windows 11), each test run three times: the 186 ctest entries of the focused set's executables, agc_driver_eqaa_color_target among them, pass 186/186 on 9465e32e3, and 186/186 under the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V): 785 Insert instance layer lines, no VUID- line, and 13 warnings, the ones main shows in the same tests. main b1b5353cf passes a 207-entry set holding all of these but the EQAA test in both runs, with no VUID- line. Control: 47d9c5125 without 3e3ddc10c fails agc_driver_eqaa_color_target with a read of the EQAA target's FMASK was not refused by name: (the access retired the target).

  • Refreshed onto main bb04a4f1e (head 1c1de3695; the debt-file conflict resolved by keeping main's "Multisampled target guest access" text and moving the fragment-count detail into the "EQAA color targets" entry), RTX 4090, each test run three times: the 176 ctest entries of the focused set's executables pass 176/176, and 176/176 under the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V), with 775 Insert instance layer lines and no VUID- line or was not found but was requested by env var VK_INSTANCE_LAYERS. main bb04a4f1e passes its 175 (no agc_driver_eqaa_color_target) in both runs, 770 Insert instance layer lines, no VUID- line. agc_host_import_cut_lifetime (#10746) passes on both now.

  • Control for the retireUnmapped change: this head with the old second pass (range.metadataValid && !range.active->load(...)): agc_driver_eqaa_color_target fails with removing only the FMASK allocation of an EQAA target left its color plane guarded.

  • Refreshed onto main ca6e29e83 (head 802f23b93; the debt-file conflict resolved by keeping both changes): of the 164 ctest entries of the focused set's executables, 163 pass, agc_driver_eqaa_color_target among them, and the same 163 under the validation layer (same settings as below), where the loader inserted the layer and the log has no VUID- line or was not found but was requested by env var VK_INSTANCE_LAYERS. The one failure, agc_host_import_cut_lifetime (the larger side of an unmap of 1440 KiB at the start of the import's first 2 MiB run left the write watch), fails the same way on main ca6e29e83, which passes 162 of its 163 entries (it has no agc_driver_eqaa_color_target) in both runs.

  • On @adriadam10's rebase onto main 8a85a5c84 and his e6b1952b5, after merging main 1c9064435 (f9971fc7b) and following main's one-fragment decode in two decode-test expectations (51969a15f), RTX 4090, each test run three times. The set is 159 ctest entries of 20 targets: the 19 below plus agc_driver_recorder_tests, whose multisample guest access and one-fragment FMASK guard tests share the guard list this PR extends.

    • This PR: 158/159. The one failure is agc_host_import_cut_lifetime (#10746), which fails the same way on main.
    • main d31f372e3: 157/158, the same #10746 failure.
    • Control: main d31f372e3 with only this PR's GPU test: agc_driver_eqaa_color_target fails with main's color targets with more than one but fewer fragments than samples (EQAA) are unsupported.
    • Validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V) on the same entries, on main and on this PR: the layer is inserted in both logs (685 and 690 Insert instance layer lines), neither has a VUID- line or was not found but was requested by env var VK_INSTANCE_LAYERS, and both fail only #10746's entry.
    • sizeof(State) stays at main's 840 (a macOS probe gives 840 for both main 1c9064435 and this head, the value of main's Linux guard).
  • Refreshed onto main 0db47b263 (head d9024161f; no conflicts), RTX 4090 (NVIDIA 616.92, Windows 11): the 64 ctest entries of the focused set below (with agc_driver_eqaa_color_target) pass 64/64, each test run three times, and 64/64 under the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V), with no VUID- line; its only messages are main's three Undefined-Value-ShaderOutputNotConsumed-DynamicRendering warnings from agc_driver_alpha_to_coverage. main 0db47b263 passes the union of the refreshed sets, 115/115, under the same layer settings with no VUID- line.
    Windows 11 (build 26200), NVIDIA GeForce RTX 4090 (driver 616.92), MinGW GCC Release build with BUILD_TESTING=ON, all on one machine.

  • Focused set: the 63 ctest entries of 19 targets (62 before the main merge). These are agc_driver_graphics_tests (the CPU decode tests, with a new EQAA case), the new agc_driver_eqaa_color_target_tests, and the MSAA, FMASK, CMASK and journal tests: alpha_to_coverage, cached_image_multisample_guard, cmask_fast_clear, color565_target, fmask_image_reads, image_msaa_address_on_plane, msaa_enable_single_sample, multisample_fill_host_only, multisample_readback, multisample_retirement, multisampled_pass_order, native_multisample_depth, pipeline_journal, pixel_sample_coverage, sample_mask_multisample, sample_multisample_target, staged_clear_sampled_read.

  • This PR (43a91814a, which merges main 7e69be679): 63/63 passed, each test run three times (ctest --repeat until-fail:3).

  • After the merge, main (#7948) decodes an FMASK base for every multisampled target, so 43a91814a drops the decode test's check that a 4-sample 4-fragment target has none; it still checks that such a target is not EQAA.

  • Control for the FMASK guard move: this head without the move in acquire(). The new test fails with a read of the FMASK base the EQAA target was last drawn with was not refused by name.

  • Validation layer: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0), ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 with ctest -V, on main 83462cc57 (7e69be679 plus eight commits to tools/ only) (62/62; the new test isn't on main) and on this PR (63/63). Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS. Neither log has a VUID- line. Both have the same three Undefined-Value-ShaderOutputNotConsumed-DynamicRendering warnings, from main's agc_driver_alpha_to_coverage.

  • Before the main merge (22766abc5 on main 7e2ba73e4): 62/62 three times. main control there: main 6ef5a1c4c plus only the new GPU test and its CMake line; the test fails with AGC graphics: color targets with fewer fragments than samples (EQAA) are unsupported.

  • The GPU test draws two slanted triangles, red and green, into a 256x256 RGBA8 target with 4 samples and 2 fragments and into the same target at 4 fragments, then CB-resolves both into one-sample targets. It requires byte-identical results, with edge texels at one-quarter and three-quarter coverage (410 such channels). It also checks that a read of the EQAA FMASK range is refused by name, that the color guard ends at the 2-fragment footprint (512 KiB, not 1 MiB), and that the 4x target's FMASK is not guarded. Then it draws the EQAA color surface again with a second FMASK base and checks that a read of the new base is refused by name and the old base is no longer guarded. Last, it removes only the FMASK allocation of a drawn EQAA target and checks that its color plane is no longer guarded and that the next draw guards a new target, then removes only the color allocation of another and checks that its FMASK range goes.

  • The CPU tests decode GT7's registers (PA_SC_AA_CONFIG 0x0020c002, CB_COLOR_INFO 0xe028, CB_COLOR_ATTRIB 0xa000, an FMASK base with pipe-bank bits) through the draw-key register facade (0x3a0 now covered), as well as 8 samples with 4 fragments. They check the refusals: more fragments than samples, no COMPRESSION, no FMASK base and a bad FMASK_BASE_EXT. They also check the CB resolve's source decode and the 4x, 4s/2f and 8s/4f footprints.

  • Not run on Linux. sizeof(State) stays at main's 808: a probe built on macOS gives 784, 792 and 808 for main 7e2ba73e4, this PR's previous head and main 7e69be679, the values of their Linux guards, and 808 for this head. tools/check_conventions.py passes.

  • Gran Turismo 7 (PPSA01317) on a local stack of main with the open PRs it needs before this stop (#7243, #7256, #7550, #7978, #8564, #9020, #9335, #9068), with its diagnostic switches that skip refused compute dispatches (at the revision before the one-fragment refusal; GT7's target has two fragments): the run no longer stops on the EQAA refusal, and nothing hits the FMASK or color guard. After CROSS at the main menu it renders the car loading screens, then stops on the next pass: a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported for points or lines and with ... DB_EQAA Z interpolation or overrasterization. That pass keeps the EQAA pass's 4x PA_SC_AA_CONFIG with DB_EQAA 0x00050000 (INTERPOLATE_COMP_Z); it is a separate topic for a follow-up PR.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none. #9450 went first, as proposed, and this PR now merges main and keeps both. #9533 (with #9717 and #9742) goes after this PR and rebases over it. main now covers CB_COLOR*_FMASK_BASE_EXT in DrawKeyRegisters itself, so this PR no longer extends that list and no longer overlaps #9431 there. #10049 (mine): whichever lands second keeps this PR's EQAA FMASK range out of #10049's color-plane test.
  • Fixes: none
  • Unblocks: PPSA01317 #4697 (moves it past this stop; it next stops on the depth refusal under Tested)
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 616.92, Windows 11 build 26200
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4964758126 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700). Originally posted by [frankea](https://github.com/frankea) on 2026-10-22T08:56:48Z. --- ### What `DecodeColorBuffer` refused every color target whose `CB_COLOR_ATTRIB.NUM_FRAGMENTS` is below `NUM_SAMPLES` (EQAA): "color targets with fewer fragments than samples (EQAA) are unsupported". This accepts such a target when it has FMASK (`CB_COLOR_INFO.COMPRESSION` and a `CB_COLOR*_FMASK` base) and no DCC, and draws it as the existing host multisampled target at its coverage sample count. - `ColorTarget` gains `eqaaFragments` (0 when the fragments equal the samples). The FMASK base is #7948's `fmaskAddress`, which `main` decodes for every multisampled target; `CB_COLOR*_FMASK_BASE_EXT` (context 0x3a0 + slot) is now in `DrawKeyRegisters`. `samples` stays `NUM_SAMPLES`, as `main`'s `coverageSamples` is, so pipelines, draws, CMASK fast clears, the FMASK decompress and the CB resolve are the existing MSAA path. `eqaaFragments` fits in existing padding, so `sizeof(State)` and the pipeline journal are unchanged; a pipeline depends on the coverage sample count, not the fragment count. - The guest footprint (`MultisampledColorBytes`, the guarded range, color fills) uses the fragment count, as addrlib sizes the surface: a 4-sample 2-fragment 512x512 RGBA8 target occupies 2 MiB, not 4. - The FMASK plane is guarded as a `Z_64KB_X` surface of 1, 2 or 4 bytes per pixel, so a T#, CPU or DMA read of it throws by name ("overlaps the FMASK of EQAA color target") instead of reading memory the host never wrote. An unmap or allocation removal of either plane retires all of the target's guards; the second pass of `retireUnmapped` now drops every inactive range, not only metadata ranges. - The FMASK guard follows the FMASK base. When a resident EQAA target is drawn again with another `CB_COLOR*_FMASK` base, `acquire()` replaces its FMASK guard with one at the new base and keeps the target and its samples. The target's identity stays surface, format, extent, samples and fragments, so its contents carry over. The move bumps `main`'s guarded-range generation (#6628), as every other guard change does. - With #8223 in `main`, the FMASK range shares the target's `TargetUse`: a bind of another target over it claims the target, and a CPU write over it after the target's last use retires it, as for the color plane. Each use stamp first collects the FMASK plane's writes (3e3ddc10c), so CPU writes made before the draw do not count as overwrites. - Sampling an EQAA target through a T# and storage image access to it throw ("... EQAA color target ... is not implemented"). EQAA without FMASK, with DCC, or with more fragments than samples throws. A one-fragment target takes #9450's path on `main` (one sample, `samples` 1 and `coverageSamples` `NUM_SAMPLES`, FMASK guarded); `coverageSamples` stays the sample count for this PR's targets too, so #9450's one-fragment checks see them as ordinary N-sample targets. - Technical debt: a new "EQAA color targets" entry, which also says the guest-access guard sizes the color plane by fragments; "Multisampled color targets" names the FMASK range. "Multisampled target guest access" is unchanged from `main`. GPU semantics, with sources: - `NUM_SAMPLES` is the coverage sample count and `NUM_FRAGMENTS` the number of colors stored per pixel. PAL and Mesa program them that way: [PAL gfx9ColorTargetView.cpp](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/hw/gfxip/gfx9/gfx9ColorTargetView.cpp#L680-L681) and [Mesa ac_descriptors.c](https://gitlab.freedesktop.org/mesa/mesa/-/blob/761d5c8a54f93b3d43608f718910ed742983dd0b/src/amd/common/ac_descriptors.c#L1339-L1340). - addrlib sizes the color surface by its fragments: [ac_surface.c](https://gitlab.freedesktop.org/mesa/mesa/-/blob/761d5c8a54f93b3d43608f718910ed742983dd0b/src/amd/common/ac_surface.c#L3119-L3123), with the block rule the "Multisampled target guest access" debt entry already cites. - FMASK holds, per sample, the fragment it uses or "unknown" ([Mesa ac_descriptors.h](https://gitlab.freedesktop.org/mesa/mesa/-/blob/761d5c8a54f93b3d43608f718910ed742983dd0b/src/amd/common/ac_descriptors.h#L142-L156)). Its element is 1 byte for 4 samples and 2 fragments, and 1, 2 or 4 bytes across the other counts ([ac_descriptors.c](https://gitlab.freedesktop.org/mesa/mesa/-/blob/761d5c8a54f93b3d43608f718910ed742983dd0b/src/amd/common/ac_descriptors.c#L214-L256)). - The host keeps a color per coverage sample, which equals the console wherever a pixel needs at most `NUM_FRAGMENTS` distinct colors. Where more primitives meet in a pixel, the console marks samples unknown and the CB resolve drops them ([radeonsi si_state.c](https://gitlab.freedesktop.org/mesa/mesa/-/blob/761d5c8a54f93b3d43608f718910ed742983dd0b/src/gallium/drivers/radeonsi/si_state.c#L3342-L3346)). Which samples it drops is not documented or measured, so a resolve here can differ at those pixels. The debt entry says so. - One fragment behaves differently, which is why it takes #9450's path instead. @fma-rc's radeonsi measurements in #9450 (`GL_AMD_framebuffer_multisample_advanced`, RDNA2) show the split: with 2 or 4 storage samples, draws that cover part of a pixel resolve to blends, as a host color per sample does; with 1 storage sample only what sample 0 covers survives. Why: Gran Turismo 7 (PPSA01317) stops on this refusal when it loads the World Map and when it delivers a purchased car, at a 512x512 RGBA8 target with 4 samples and 2 fragments (`CB_COLOR_INFO` 0x0000e028, `CB_COLOR_ATTRIB` 0x0000a000, CMASK and FMASK). The title consumes the target only through a CB resolve. Overlap with other PRs: - #7948 (merged) serves FMASK T# reads of tracked 8-sample DCC targets. An EQAA target has no DCC, so a T# read of its FMASK still throws. - #8429 (merged) decodes FMASK T# reads from guest memory, `FMASK8_S4_F2` included. With this PR, such a read of a host EQAA target's FMASK throws through the guard until the driver serves FMASK from the host target, as #7948 does for 8-fragment targets. - #9450 (merged) draws a 4-sample 1-fragment target as one sample with sample 0's coverage and guards its FMASK range. With `main` merged in, the two cover disjoint fragment counts in one decode: one fragment takes #9450's branch, two or more below the samples this PR's. #9450's FMASK ranges and this PR's are separate guard kinds with their own messages. - #10049 (mine) retires a multisampled target that a write-only storage store overwrites. Its color-plane test (`!metadataValid && !fmask`) would also match this PR's EQAA FMASK range, so whichever lands second keeps that range out of the test. The two also conflict in the libSceAgcDriver debt file. - #9533, with #9717 and #9742 stacked on it, moves the guarded byte count into `guardedColorBytes(target)`, as @EagleBearerYS noted. `main` now has that function from #8223, and this PR takes the fragment count there. - No open PR accepts more than one but fewer `NUM_FRAGMENTS` than `NUM_SAMPLES` in `DecodeColorBuffer`. ### Tested - Refreshed onto `main` ee9a9a66c (47d9c5125; #8223's guard rework resolved as described in the comments), fixed in 3e3ddc10c, and refreshed onto `main` b1b5353cf (head 9465e32e3; #6628), RTX 4090 (NVIDIA 616.92, Windows 11), each test run three times: the 186 ctest entries of the focused set's executables, `agc_driver_eqaa_color_target` among them, pass 186/186 on 9465e32e3, and 186/186 under the validation layer (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`): 785 `Insert instance layer` lines, no `VUID-` line, and 13 warnings, the ones `main` shows in the same tests. `main` b1b5353cf passes a 207-entry set holding all of these but the EQAA test in both runs, with no `VUID-` line. Control: 47d9c5125 without 3e3ddc10c fails `agc_driver_eqaa_color_target` with `a read of the EQAA target's FMASK was not refused by name:` (the access retired the target). - Refreshed onto `main` bb04a4f1e (head 1c1de3695; the debt-file conflict resolved by keeping `main`'s "Multisampled target guest access" text and moving the fragment-count detail into the "EQAA color targets" entry), RTX 4090, each test run three times: the 176 ctest entries of the focused set's executables pass 176/176, and 176/176 under the validation layer (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`), with 775 `Insert instance layer` lines and no `VUID-` line or `was not found but was requested by env var VK_INSTANCE_LAYERS`. `main` bb04a4f1e passes its 175 (no `agc_driver_eqaa_color_target`) in both runs, 770 `Insert instance layer` lines, no `VUID-` line. `agc_host_import_cut_lifetime` (#10746) passes on both now. - Control for the `retireUnmapped` change: this head with the old second pass (`range.metadataValid && !range.active->load(...)`): `agc_driver_eqaa_color_target` fails with `removing only the FMASK allocation of an EQAA target left its color plane guarded`. - Refreshed onto `main` ca6e29e83 (head 802f23b93; the debt-file conflict resolved by keeping both changes): of the 164 ctest entries of the focused set's executables, 163 pass, `agc_driver_eqaa_color_target` among them, and the same 163 under the validation layer (same settings as below), where the loader inserted the layer and the log has no `VUID-` line or `was not found but was requested by env var VK_INSTANCE_LAYERS`. The one failure, `agc_host_import_cut_lifetime` (`the larger side of an unmap of 1440 KiB at the start of the import's first 2 MiB run left the write watch`), fails the same way on `main` ca6e29e83, which passes 162 of its 163 entries (it has no `agc_driver_eqaa_color_target`) in both runs. - On @adriadam10's rebase onto `main` 8a85a5c84 and his e6b1952b5, after merging `main` 1c9064435 (f9971fc7b) and following `main`'s one-fragment decode in two decode-test expectations (51969a15f), RTX 4090, each test run three times. The set is 159 ctest entries of 20 targets: the 19 below plus `agc_driver_recorder_tests`, whose multisample guest access and one-fragment FMASK guard tests share the guard list this PR extends. - This PR: 158/159. The one failure is `agc_host_import_cut_lifetime` (#10746), which fails the same way on `main`. - `main` d31f372e3: 157/158, the same #10746 failure. - Control: `main` d31f372e3 with only this PR's GPU test: `agc_driver_eqaa_color_target` fails with `main`'s `color targets with more than one but fewer fragments than samples (EQAA) are unsupported`. - Validation layer (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`) on the same entries, on `main` and on this PR: the layer is inserted in both logs (685 and 690 `Insert instance layer` lines), neither has a `VUID-` line or `was not found but was requested by env var VK_INSTANCE_LAYERS`, and both fail only #10746's entry. - `sizeof(State)` stays at `main`'s 840 (a macOS probe gives 840 for both `main` 1c9064435 and this head, the value of `main`'s Linux guard). - Refreshed onto `main` 0db47b263 (head d9024161f; no conflicts), RTX 4090 (NVIDIA 616.92, Windows 11): the 64 ctest entries of the focused set below (with `agc_driver_eqaa_color_target`) pass 64/64, each test run three times, and 64/64 under the validation layer (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`), with no `VUID-` line; its only messages are `main`'s three `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering` warnings from `agc_driver_alpha_to_coverage`. `main` 0db47b263 passes the union of the refreshed sets, 115/115, under the same layer settings with no `VUID-` line. Windows 11 (build 26200), NVIDIA GeForce RTX 4090 (driver 616.92), MinGW GCC Release build with `BUILD_TESTING=ON`, all on one machine. - Focused set: the 63 ctest entries of 19 targets (62 before the `main` merge). These are `agc_driver_graphics_tests` (the CPU decode tests, with a new EQAA case), the new `agc_driver_eqaa_color_target_tests`, and the MSAA, FMASK, CMASK and journal tests: alpha_to_coverage, cached_image_multisample_guard, cmask_fast_clear, color565_target, fmask_image_reads, image_msaa_address_on_plane, msaa_enable_single_sample, multisample_fill_host_only, multisample_readback, multisample_retirement, multisampled_pass_order, native_multisample_depth, pipeline_journal, pixel_sample_coverage, sample_mask_multisample, sample_multisample_target, staged_clear_sampled_read. - This PR (43a91814a, which merges `main` 7e69be679): 63/63 passed, each test run three times (`ctest --repeat until-fail:3`). - After the merge, `main` (#7948) decodes an FMASK base for every multisampled target, so 43a91814a drops the decode test's check that a 4-sample 4-fragment target has none; it still checks that such a target is not EQAA. - Control for the FMASK guard move: this head without the move in `acquire()`. The new test fails with `a read of the FMASK base the EQAA target was last drawn with was not refused by name`. - Validation layer: `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Vulkan SDK 1.4.363.0), `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1` with `ctest -V`, on `main` 83462cc57 (7e69be679 plus eight commits to `tools/` only) (62/62; the new test isn't on `main`) and on this PR (63/63). Neither log has `was not found but was requested by env var VK_INSTANCE_LAYERS`. Neither log has a `VUID-` line. Both have the same three `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering` warnings, from `main`'s `agc_driver_alpha_to_coverage`. - Before the `main` merge (22766abc5 on `main` 7e2ba73e4): 62/62 three times. `main` control there: `main` 6ef5a1c4c plus only the new GPU test and its CMake line; the test fails with `AGC graphics: color targets with fewer fragments than samples (EQAA) are unsupported`. - The GPU test draws two slanted triangles, red and green, into a 256x256 RGBA8 target with 4 samples and 2 fragments and into the same target at 4 fragments, then CB-resolves both into one-sample targets. It requires byte-identical results, with edge texels at one-quarter and three-quarter coverage (410 such channels). It also checks that a read of the EQAA FMASK range is refused by name, that the color guard ends at the 2-fragment footprint (512 KiB, not 1 MiB), and that the 4x target's FMASK is not guarded. Then it draws the EQAA color surface again with a second FMASK base and checks that a read of the new base is refused by name and the old base is no longer guarded. Last, it removes only the FMASK allocation of a drawn EQAA target and checks that its color plane is no longer guarded and that the next draw guards a new target, then removes only the color allocation of another and checks that its FMASK range goes. - The CPU tests decode GT7's registers (`PA_SC_AA_CONFIG` 0x0020c002, `CB_COLOR_INFO` 0xe028, `CB_COLOR_ATTRIB` 0xa000, an FMASK base with pipe-bank bits) through the draw-key register facade (0x3a0 now covered), as well as 8 samples with 4 fragments. They check the refusals: more fragments than samples, no `COMPRESSION`, no FMASK base and a bad `FMASK_BASE_EXT`. They also check the CB resolve's source decode and the 4x, 4s/2f and 8s/4f footprints. - Not run on Linux. `sizeof(State)` stays at `main`'s 808: a probe built on macOS gives 784, 792 and 808 for `main` 7e2ba73e4, this PR's previous head and `main` 7e69be679, the values of their Linux guards, and 808 for this head. `tools/check_conventions.py` passes. - Gran Turismo 7 (PPSA01317) on a local stack of `main` with the open PRs it needs before this stop (#7243, #7256, #7550, #7978, #8564, #9020, #9335, #9068), with its diagnostic switches that skip refused compute dispatches (at the revision before the one-fragment refusal; GT7's target has two fragments): the run no longer stops on the EQAA refusal, and nothing hits the FMASK or color guard. After CROSS at the main menu it renders the car loading screens, then stops on the next pass: `a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported for points or lines and with ... DB_EQAA Z interpolation or overrasterization`. That pass keeps the EQAA pass's 4x `PA_SC_AA_CONFIG` with `DB_EQAA` 0x00050000 (INTERPOLATE_COMP_Z); it is a separate topic for a follow-up PR. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none. #9450 went first, as proposed, and this PR now merges `main` and keeps both. #9533 (with #9717 and #9742) goes after this PR and rebases over it. `main` now covers `CB_COLOR*_FMASK_BASE_EXT` in `DrawKeyRegisters` itself, so this PR no longer extends that list and no longer overlaps #9431 there. #10049 (mine): whichever lands second keeps this PR's EQAA FMASK range out of #10049's color-plane test. - [x] Fixes: none - [x] Unblocks: PPSA01317 #4697 (moves it past this stop; it next stops on the depth refusal under Tested) - [x] GPUs tested: NVIDIA GeForce RTX 4090, driver 616.92, Windows 11 build 26200 - [x] AI-assisted: yes
clairtonmichel commented 2026-10-22 09:12:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-22T09:12:32Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran the AGC driver test suite (640 tests): passed successfully, aligning perfectly with environment baselines (known pre-existing test quirks).
  • EQAA color target changes are stable and ready to merge!
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337128571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#issuecomment-6337128571). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-22T09:12:32Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran the AGC driver test suite (640 tests): passed successfully, aligning perfectly with environment baselines (known pre-existing test quirks). - EQAA color target changes are stable and ready to merge!
jotitadev commented 2026-10-22 10:25:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T10:25:07Z.

Review: COMMENTED


Apple GPU run of 22766abc5: the new test passes on MoltenVK and fails without the change.

Setup: Apple M2 Max, macOS 27.2, x86-64 under Rosetta 2, Release. Base is #8658 (feat/macos-port) @ f48446abb (main plus the macOS port), not main; your diff from 7e2ba73e4 applies cleanly on it. Two drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363) and MoltenVK main + SPIRV-Cross #2704. ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 30.

  • This PR: agc_driver_eqaa_color_target passes 3 of 3 on both drivers: 4-sample 2-fragment draws resolve like 4x MSAA (262144 bytes), 410 quarter-coverage channels, FMASK guarded. That is the same 410 channels as on your 4090, so Metal's 4x sample positions give the same edge coverage. Your focused set (32 ctest entries: agc_driver_graphics, the new test, and the MSAA, FMASK, CMASK and journal tests) with --repeat until-fail:3: the only failures are multisample_retirement and sample_mask_multisample. Both fail the same way on the base without this PR.
  • Test only, production files at the base (new EqaaColorTarget.cpp and its CMake line): fails on both drivers with AGC graphics: color targets with fewer fragments than samples (EQAA) are unsupported, the same as your main control.
  • Full ^agc (857 entries, without flip/display/lds_atomics64): MoltenVK main + #2704 gives exactly the base's 16 failures. MoltenVK 1.4.2 gives the base's 17, plus agc_driver_uint8x4_color_target, which is intermittent on Apple without this PR too (it fails in 19 of 150 runs on the base). No new failures.
  • The sizeof(State) == 792 assert is under __linux__ && __GLIBCXX__, so it doesn't apply to the macOS libc++ build. The macOS build compiles with no errors.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5612728439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#pullrequestreview-5612728439). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-22T10:25:07Z. **Review:** COMMENTED --- Apple GPU run of 22766abc5: the new test passes on MoltenVK and fails without the change. Setup: Apple M2 Max, macOS 27.2, x86-64 under Rosetta 2, Release. Base is #8658 (`feat/macos-port`) @ f48446abb (`main` plus the macOS port), not `main`; your diff from 7e2ba73e4 applies cleanly on it. Two drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363) and MoltenVK main + SPIRV-Cross #2704. `ANYPS5_NO_SHADER_CACHE=1`, `-j1 --timeout 30`. - **This PR:** `agc_driver_eqaa_color_target` passes 3 of 3 on both drivers: `4-sample 2-fragment draws resolve like 4x MSAA (262144 bytes), 410 quarter-coverage channels, FMASK guarded`. That is the same 410 channels as on your 4090, so Metal's 4x sample positions give the same edge coverage. Your focused set (32 ctest entries: `agc_driver_graphics`, the new test, and the MSAA, FMASK, CMASK and journal tests) with `--repeat until-fail:3`: the only failures are `multisample_retirement` and `sample_mask_multisample`. Both fail the same way on the base without this PR. - **Test only, production files at the base** (new `EqaaColorTarget.cpp` and its CMake line): fails on both drivers with `AGC graphics: color targets with fewer fragments than samples (EQAA) are unsupported`, the same as your `main` control. - **Full `^agc`** (857 entries, without flip/display/`lds_atomics64`): MoltenVK main + #2704 gives exactly the base's 16 failures. MoltenVK 1.4.2 gives the base's 17, plus `agc_driver_uint8x4_color_target`, which is intermittent on Apple without this PR too (it fails in 19 of 150 runs on the base). No new failures. - The `sizeof(State) == 792` assert is under `__linux__ && __GLIBCXX__`, so it doesn't apply to the macOS libc++ build. The macOS build compiles with no errors. GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-22 12:19:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:19:41Z.

Review: DISMISSED


I reviewed the decode, fragment-sized guest footprint, FMASK guard, resolve path, and the execution test. The author reports 62/62 focused tests on an RTX 4090 with three repeats and validation-layer comparison; an independent Apple/MoltenVK report also says the new test passes. I could not independently build or run the C++ tests in this Linux checkout because no configured product build is available.

There is a guard-lifetime issue at sameTarget (I left an inline comment): the cache key includes eqaaFragments but omits fmaskAddress. If the same color surface is reused with a different FMASK base, acquire() can return the existing target without refreshing its guard, leaving the new FMASK range unprotected. Please make the target/guard follow the current FMASK address and add a regression that changes the FMASK base for the same color surface.

Please also update this branch to current main (8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768); the current head is based on 7e2ba73e4c, 13 commits behind. Rerun the focused tests after rebasing.

The overlap report lists shared changes with #7948 and #9450, which this description already discusses, and newly open #9672 through #9675, which touch State.hpp's register ranges and/or State.cpp's target decode. The repository asks authors to agree on landing order for overlapping code and declare Depends on when a stack is required. Please coordinate with those authors and update the checklist if this change depends on a particular order. I am treating these as shared-file coordination needs, not assuming the separate PS4/PS5 behavior is duplicate work.

Local checks: git diff --check is clean. GitHub conventions, eligibility, intake, labels and report checks pass; product CI jobs are skipped by the repository gates. I did not independently reproduce the author-reported GPU results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614011330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#pullrequestreview-5614011330). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:19:41Z. **Review:** DISMISSED --- I reviewed the decode, fragment-sized guest footprint, FMASK guard, resolve path, and the execution test. The author reports 62/62 focused tests on an RTX 4090 with three repeats and validation-layer comparison; an independent Apple/MoltenVK report also says the new test passes. I could not independently build or run the C++ tests in this Linux checkout because no configured product build is available. There is a guard-lifetime issue at `sameTarget` (I left an inline comment): the cache key includes `eqaaFragments` but omits `fmaskAddress`. If the same color surface is reused with a different FMASK base, `acquire()` can return the existing target without refreshing its guard, leaving the new FMASK range unprotected. Please make the target/guard follow the current FMASK address and add a regression that changes the FMASK base for the same color surface. Please also update this branch to current `main` (`8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768`); the current head is based on `7e2ba73e4c`, 13 commits behind. Rerun the focused tests after rebasing. The overlap report lists shared changes with #7948 and #9450, which this description already discusses, and newly open #9672 through #9675, which touch `State.hpp`'s register ranges and/or `State.cpp`'s target decode. The repository asks authors to agree on landing order for overlapping code and declare `Depends on` when a stack is required. Please coordinate with those authors and update the checklist if this change depends on a particular order. I am treating these as shared-file coordination needs, not assuming the separate PS4/PS5 behavior is duplicate work. Local checks: `git diff --check` is clean. GitHub conventions, eligibility, intake, labels and report checks pass; product CI jobs are skipped by the repository gates. I did not independently reproduce the author-reported GPU results.
EagleBearerYS commented 2026-10-22 12:42:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T12:42:29Z.


@frankea a merge-order note: #9533, with #9717 and #9742 stacked on it, moves the guarded byte count out of guard() into guardedColorBytes(target), so its colour-target alias query (whether a host-only colour target covers a D32S8 stencil or depth plane) uses the same range as the guard. This PR changes that count to use storedFragments(target) in place of the sample count. Composed, the fragment count goes into guardedColorBytes, so the guard and the alias query keep covering the same bytes. #9533 goes after this PR and rebases over it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341018765 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#issuecomment-6341018765). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T12:42:29Z. --- @frankea a merge-order note: #9533, with #9717 and #9742 stacked on it, moves the guarded byte count out of `guard()` into `guardedColorBytes(target)`, so its colour-target alias query (whether a host-only colour target covers a D32S8 stencil or depth plane) uses the same range as the guard. This PR changes that count to use `storedFragments(target)` in place of the sample count. Composed, the fragment count goes into `guardedColorBytes`, so the guard and the alias query keep covering the same bytes. #9533 goes after this PR and rebases over it.
XairRrR commented 2026-10-29 04:07:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T04:07:37Z.

Review: DISMISSED


Reviewed — changes requested

The EQAA decode, the fragment-sized guard and the FMASK guard build and pass the focused tests on this head, with no validation errors, and the new GPU test fails without the change; the branch conflicts with current main in the AgcDriver debt file again, so it needs another merge.

What I ran

  • Head: 802f23b930245103e3e9b410c266886055367456 (merge base ca6e29e8363e3d10e9e6482bede3d19d6b9f0e6e)
  • main: b433c40f2f46aa2e59e19806010a839ac8572d64
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja, a clean worktree.

The merge with main conflicted, so I built and tested the PR head itself.

git fetch origin main pull/9700/head:refs/review/9700
git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/9700   # conflict, aborted
git checkout --detach refs/review/9700
git diff --check origin/main...refs/review/9700
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_eqaa_color_target_tests \
  agc_driver_cached_image_multisample_guard_tests agc_driver_cmask_fast_clear_tests agc_driver_fmask_image_reads_tests \
  agc_driver_multisampled_pass_order_tests agc_driver_multisample_fill_host_only_tests agc_driver_multisample_readback_tests \
  agc_driver_multisample_retirement_tests agc_driver_recorder_tests agc_driver_sample_multisample_target_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V --output-on-failure --timeout 120 -R 'agc_driver_eqaa_color_target$|agc_driver_graphics$|agc_multisample_guest_access|agc_driver_native_fmask|agc_driver_cmask_fast_clear|cached_image_multisample_guard|fmask_image_reads|multisample_fill_host_only|multisample_retirement$|agc_driver_multisample_readback$|sample_multisample_target$|multisampled_pass_order'
# the same build (without the new target) and ctest run on origin/main

Results

Check Result
Merge into main b433c40f2 Conflict in docs/dev/debt/libSceAgcDriver.md; the five code and CMake files merge cleanly
git diff --check Clean
tools/check_conventions.py 0 errors, 1 warning: docs/dev/debt/libSceAgcDriver.md:192 debt entry is 1956 characters long
Build of the 11 test executables (PR head) OK, no new warnings in the changed files
Focused ctest, PR head, validation layer 12/12 passed; agc_driver_graphics prints EQAA color target decode checks passed
Focused ctest, main, validation layer 11/11 passed (main has no agc_driver_eqaa_color_target)
VUID- lines 0 on the PR head, 0 on main
was not found but was requested by env var VK_INSTANCE_LAYERS Absent in both logs; Insert instance layer appears once per test in both (12 and 11)
sizeof(State) guard Compiles on Linux/libstdc++, so the size is unchanged
New GPU test, PR head
803: EQAA color target tests passed: 4-sample 2-fragment draws resolve like 4x MSAA (262144 bytes), 410 quarter-coverage channels, FMASK guarded at the base of the last draw
 7/12 Test #803: agc_driver_eqaa_color_target ................ Passed 0.41 sec
Merge conflict

main added the CB fast-clear eliminate over part of a target entry right after Multisampled target guest access. This PR rewrites that entry and adds EQAA color targets after it, so the two hunks touch adjacent lines:

++<<<<<<< HEAD
 +- [Multisampled target guest access](...) ... sample count. ...
 +- [CB fast-clear eliminate over part of a target](...) ...
++=======
+ - [Multisampled target guest access](...) ... sample count and EQAA fragment count. ...
+ - [EQAA color targets](...) ...
++>>>>>>> refs/review/9700

Negative control

  • Production files reverted to the merge base (State.hpp, State.cpp and MultisampleTarget.cpp from ca6e29e83; tests and CMake from this PR): agc_driver_eqaa_color_target fails with AGC graphics: color targets with more than one but fewer fragments than samples (EQAA) are unsupported. agc_driver_graphics_tests doesn't compile, because the new decode test uses ColorTarget::eqaaFragments.
  • Only the retireUnmapped change reverted (MultisampleTarget.cpp:821 back to range.metadataValid && !range.active->load(...)): agc_driver_eqaa_color_target, agc_multisample_guest_access, agc_driver_multisample_retirement and agc_driver_graphics all still pass. See the first non-blocking finding.

All files were restored to the PR head afterwards.

Findings

Blocking

  1. Conflict with main in docs/dev/debt/libSceAgcDriver.md. This confirms @oneandonlydean's note, with the detail above. The head is based on ca6e29e83, and main has since added the CB fast-clear eliminate over part of a target entry next to the Multisampled target guest access entry this PR edits (docs/dev/debt/libSceAgcDriver.md:192-193 here). The code files merge without conflicts. Fix: merge main, keep both entries, and rerun the focused set on the result. I could only test the PR head, not the merged tree.

Non-blocking

  1. The retireUnmapped change has no test. core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:821 now drops every inactive range, so unmapping only an EQAA target's FMASK plane also removes its color-plane range. Before this change, that range stayed in guarded() with hostOnly set after its target was retired, so RequireNoMultisampleColorTarget kept refusing reads of a surface no live target owns. The description lists this change, but no test fails without it (control above). Suggested test: draw the EQAA target, remove only the FMASK allocation, and check that a read of the color plane is no longer refused and that the next draw creates a fresh target. The reverse case would also help: remove the color plane and check that the FMASK range goes.
  2. The DCC refusal case is still in the decode test. core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:4290-4292 still asserts that an FMASK-backed EQAA target with CB_COLOR_INFO DCC throws. @oneandonlydean asked for this case to be dropped, because it pins a valid form as throwing. It is still present at 802f23b93. The production Require at State.cpp:2147 can stay as it is; only the test case needs to go.
  3. Debt entry length. tools/check_conventions.py warns that Multisampled target guest access (docs/dev/debt/libSceAgcDriver.md:192) is 1956 characters. The entry was already long, and this PR adds two parentheticals to it. While resolving the conflict, consider moving the fragment-count detail into the new EQAA color targets entry, which already describes the EQAA footprint, so the older entry stops growing.

Not verified

  • The tree merged with current main: the conflict meant I built and tested the PR head (2960 commits behind main) and main separately.
  • The FMASK plane's Z_64KB_X layout and byte count against console or addrlib output. I checked only that fmaskBytes gives 1, 2 and 4 bytes per pixel for 4s/2f, 8s/2f and 8s/4f, as the cited Mesa table does.
  • Gran Turismo 7 behaviour; I did not run any title.
  • AMD hardware, Windows and macOS.

To get this to a good state

  1. Merge current main, resolve the debt-file conflict by keeping both entries, and rerun the focused set with the validation layer on the merge.
  2. Drop the DCC refusal case at tests/Graphics.cpp:4290-4292, as requested earlier.
  3. Optionally, add a regression for the retireUnmapped change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692735612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#pullrequestreview-5692735612). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T04:07:37Z. **Review:** DISMISSED --- # Reviewed — changes requested The EQAA decode, the fragment-sized guard and the FMASK guard build and pass the focused tests on this head, with no validation errors, and the new GPU test fails without the change; the branch conflicts with current `main` in the AgcDriver debt file again, so it needs another merge. ## What I ran - Head: `802f23b930245103e3e9b410c266886055367456` (merge base `ca6e29e8363e3d10e9e6482bede3d19d6b9f0e6e`) - `main`: `b433c40f2f46aa2e59e19806010a839ac8572d64` - Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja, a clean worktree. The merge with `main` conflicted, so I built and tested the PR head itself. ```sh git fetch origin main pull/9700/head:refs/review/9700 git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/9700 # conflict, aborted git checkout --detach refs/review/9700 git diff --check origin/main...refs/review/9700 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_eqaa_color_target_tests \ agc_driver_cached_image_multisample_guard_tests agc_driver_cmask_fast_clear_tests agc_driver_fmask_image_reads_tests \ agc_driver_multisampled_pass_order_tests agc_driver_multisample_fill_host_only_tests agc_driver_multisample_readback_tests \ agc_driver_multisample_retirement_tests agc_driver_recorder_tests agc_driver_sample_multisample_target_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j4 -V --output-on-failure --timeout 120 -R 'agc_driver_eqaa_color_target$|agc_driver_graphics$|agc_multisample_guest_access|agc_driver_native_fmask|agc_driver_cmask_fast_clear|cached_image_multisample_guard|fmask_image_reads|multisample_fill_host_only|multisample_retirement$|agc_driver_multisample_readback$|sample_multisample_target$|multisampled_pass_order' # the same build (without the new target) and ctest run on origin/main ``` ## Results | Check | Result | |---|---| | Merge into `main` b433c40f2 | Conflict in `docs/dev/debt/libSceAgcDriver.md`; the five code and CMake files merge cleanly | | `git diff --check` | Clean | | `tools/check_conventions.py` | 0 errors, 1 warning: `docs/dev/debt/libSceAgcDriver.md:192` debt entry is 1956 characters long | | Build of the 11 test executables (PR head) | OK, no new warnings in the changed files | | Focused ctest, PR head, validation layer | 12/12 passed; `agc_driver_graphics` prints `EQAA color target decode checks passed` | | Focused ctest, `main`, validation layer | 11/11 passed (`main` has no `agc_driver_eqaa_color_target`) | | `VUID-` lines | 0 on the PR head, 0 on `main` | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | Absent in both logs; `Insert instance layer` appears once per test in both (12 and 11) | | `sizeof(State)` guard | Compiles on Linux/libstdc++, so the size is unchanged | <details><summary>New GPU test, PR head</summary> ``` 803: EQAA color target tests passed: 4-sample 2-fragment draws resolve like 4x MSAA (262144 bytes), 410 quarter-coverage channels, FMASK guarded at the base of the last draw 7/12 Test #803: agc_driver_eqaa_color_target ................ Passed 0.41 sec ``` </details> <details><summary>Merge conflict</summary> `main` added the `CB fast-clear eliminate over part of a target` entry right after `Multisampled target guest access`. This PR rewrites that entry and adds `EQAA color targets` after it, so the two hunks touch adjacent lines: ``` ++<<<<<<< HEAD +- [Multisampled target guest access](...) ... sample count. ... +- [CB fast-clear eliminate over part of a target](...) ... ++======= + - [Multisampled target guest access](...) ... sample count and EQAA fragment count. ... + - [EQAA color targets](...) ... ++>>>>>>> refs/review/9700 ``` </details> ## Negative control - **Production files reverted to the merge base** (`State.hpp`, `State.cpp` and `MultisampleTarget.cpp` from ca6e29e83; tests and CMake from this PR): `agc_driver_eqaa_color_target` fails with `AGC graphics: color targets with more than one but fewer fragments than samples (EQAA) are unsupported`. `agc_driver_graphics_tests` doesn't compile, because the new decode test uses `ColorTarget::eqaaFragments`. - **Only the `retireUnmapped` change reverted** (`MultisampleTarget.cpp:821` back to `range.metadataValid && !range.active->load(...)`): `agc_driver_eqaa_color_target`, `agc_multisample_guest_access`, `agc_driver_multisample_retirement` and `agc_driver_graphics` all still pass. See the first non-blocking finding. All files were restored to the PR head afterwards. ## Findings ### Blocking 1. **Conflict with `main` in `docs/dev/debt/libSceAgcDriver.md`.** This confirms @oneandonlydean's note, with the detail above. The head is based on ca6e29e83, and `main` has since added the `CB fast-clear eliminate over part of a target` entry next to the `Multisampled target guest access` entry this PR edits (`docs/dev/debt/libSceAgcDriver.md:192-193` here). The code files merge without conflicts. Fix: merge `main`, keep both entries, and rerun the focused set on the result. I could only test the PR head, not the merged tree. ### Non-blocking 1. **The `retireUnmapped` change has no test.** `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:821` now drops every inactive range, so unmapping only an EQAA target's FMASK plane also removes its color-plane range. Before this change, that range stayed in `guarded()` with `hostOnly` set after its target was retired, so `RequireNoMultisampleColorTarget` kept refusing reads of a surface no live target owns. The description lists this change, but no test fails without it (control above). Suggested test: draw the EQAA target, remove only the FMASK allocation, and check that a read of the color plane is no longer refused and that the next draw creates a fresh target. The reverse case would also help: remove the color plane and check that the FMASK range goes. 2. **The DCC refusal case is still in the decode test.** `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:4290-4292` still asserts that an FMASK-backed EQAA target with `CB_COLOR_INFO` DCC throws. @oneandonlydean asked for this case to be dropped, because it pins a valid form as throwing. It is still present at 802f23b93. The production `Require` at `State.cpp:2147` can stay as it is; only the test case needs to go. 3. **Debt entry length.** `tools/check_conventions.py` warns that `Multisampled target guest access` (`docs/dev/debt/libSceAgcDriver.md:192`) is 1956 characters. The entry was already long, and this PR adds two parentheticals to it. While resolving the conflict, consider moving the fragment-count detail into the new `EQAA color targets` entry, which already describes the EQAA footprint, so the older entry stops growing. ## Not verified - The tree merged with current `main`: the conflict meant I built and tested the PR head (2960 commits behind `main`) and `main` separately. - The FMASK plane's `Z_64KB_X` layout and byte count against console or addrlib output. I checked only that `fmaskBytes` gives 1, 2 and 4 bytes per pixel for 4s/2f, 8s/2f and 8s/4f, as the cited Mesa table does. - Gran Turismo 7 behaviour; I did not run any title. - AMD hardware, Windows and macOS. ## To get this to a good state 1. Merge current `main`, resolve the debt-file conflict by keeping both entries, and rerun the focused set with the validation layer on the merge. 2. Drop the DCC refusal case at `tests/Graphics.cpp:4290-4292`, as requested earlier. 3. Optionally, add a regression for the `retireUnmapped` change.
MarcZX10 commented 2026-10-29 21:23:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:23:26Z.

Review: DISMISSED


Re-checked — new head, changes requested

The author addressed the prior DCC-test and retirement-coverage findings, but the current head is still based on bb04a4f1ea, and live main has since changed files this PR edits.

What I ran

Compared exact PR head 1c1de36955cdc7b114dba1b44d80ab78da3c5d87 with live main c40cef843681418b4d66df2939a92ba8ba6ba5d9 on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I did not build or run tests locally.

git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-9700-head
git diff --check refs/remotes/upstream/main...refs/review/pr-9700-head
gh pr checks 9700 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview with live main Clean; the PR is not updated onto the current base
git diff --check Passed; no output
Hosted checks Windows, conventions, labels, report and eligibility pass; Linux and specialized jobs are skipped
Focused EQAA tests and negative control Author reports the retirement regression, reverse-plane case, and old-code negative control; not independently run here
NVIDIA broad test report Author reports 2,312 passed, 5 failures (0 new), 40 skipped, and no new validation IDs on head 1c1de36955 merged with bb04a4f1ea; this is not the current main integration
Unedited command output
e0f42971c26c174d548fd2f2f3be7b2a8723b149

git diff --check produced no output and exited successfully.

Findings

Blocking

  • The current-main integration and validation are stale. The branch and its reported tests use bb04a4f1ea; live main is c40cef843681418b4d66df2939a92ba8ba6ba5d9. Commits since that tested base change files this PR edits, including MultisampleTarget.cpp, State.cpp, Graphics.cpp, and docs/dev/debt/libSceAgcDriver.md. A clean merge preview does not validate those combined changes. Please merge current main, retain its changes, and rerun the focused EQAA tests and validation comparison on the resulting exact base and head.

Non-blocking

  • The updated description and test report now include the retireUnmapped regression and its negative control, and remove the invalid DCC-throws assertion. I did not independently reproduce these results.

Sources

Not verified

I did not run the focused tests, validation layer, a local build, or a GPU/title run. The author’s results are reported, not independently confirmed.

To get this to a good state

Merge live main, rerun the focused EQAA and validation-layer checks against the updated exact head, and refresh the report. I will rerun the same integration, whitespace, and relevant test checks on that head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705154636 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#pullrequestreview-5705154636). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:23:26Z. **Review:** DISMISSED --- # Re-checked — new head, changes requested The author addressed the prior DCC-test and retirement-coverage findings, but the current head is still based on `bb04a4f1ea`, and live `main` has since changed files this PR edits. ## What I ran Compared exact PR head `1c1de36955cdc7b114dba1b44d80ab78da3c5d87` with live `main` `c40cef843681418b4d66df2939a92ba8ba6ba5d9` on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I did not build or run tests locally. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-9700-head git diff --check refs/remotes/upstream/main...refs/review/pr-9700-head gh pr checks 9700 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview with live `main` | Clean; the PR is not updated onto the current base | | `git diff --check` | Passed; no output | | Hosted checks | Windows, conventions, labels, report and eligibility pass; Linux and specialized jobs are skipped | | Focused EQAA tests and negative control | Author reports the retirement regression, reverse-plane case, and old-code negative control; not independently run here | | NVIDIA broad test report | Author reports 2,312 passed, 5 failures (0 new), 40 skipped, and no new validation IDs on head `1c1de36955` merged with `bb04a4f1ea`; this is not the current `main` integration | <details><summary>Unedited command output</summary> ```text e0f42971c26c174d548fd2f2f3be7b2a8723b149 ``` `git diff --check` produced no output and exited successfully. </details> ## Findings ### Blocking - **The current-main integration and validation are stale.** The branch and its reported tests use `bb04a4f1ea`; live `main` is `c40cef843681418b4d66df2939a92ba8ba6ba5d9`. Commits since that tested base change files this PR edits, including `MultisampleTarget.cpp`, `State.cpp`, `Graphics.cpp`, and `docs/dev/debt/libSceAgcDriver.md`. A clean merge preview does not validate those combined changes. Please merge current `main`, retain its changes, and rerun the focused EQAA tests and validation comparison on the resulting exact base and head. ### Non-blocking - The updated description and test report now include the `retireUnmapped` regression and its negative control, and remove the invalid DCC-throws assertion. I did not independently reproduce these results. ## Sources - [Contribution rule at `c40cef843681418b4d66df2939a92ba8ba6ba5d9`](https://github.com/boykopovar/AnyPS5/blob/c40cef843681418b4d66df2939a92ba8ba6ba5d9/CONTRIBUTING.md#L57) - [PR changes at `1c1de36955cdc7b114dba1b44d80ab78da3c5d87`](https://github.com/boykopovar/AnyPS5/tree/1c1de36955cdc7b114dba1b44d80ab78da3c5d87) - [Current-main AGC changes at `c40cef843681418b4d66df2939a92ba8ba6ba5d9`](https://github.com/boykopovar/AnyPS5/tree/c40cef843681418b4d66df2939a92ba8ba6ba5d9/core/libs/prx/libSceAgcDriver) ## Not verified I did not run the focused tests, validation layer, a local build, or a GPU/title run. The author’s results are reported, not independently confirmed. ## To get this to a good state Merge live `main`, rerun the focused EQAA and validation-layer checks against the updated exact head, and refresh the report. I will rerun the same integration, whitespace, and relevant test checks on that head.
XairRrR commented 2026-11-03 22:24:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T22:24:04Z.

Review: APPROVED


Re-checked — approved

The PR now merges cleanly with current main. Since 802f23b93 it drops the DCC-refusal test case, adds a regression for the retireUnmapped change, and adds a fix (3e3ddc10c) that collects FMASK-plane writes before each use stamp. On the merged tree the build passes, the focused tests pass, and three negative controls fail where they should.

What changed since my last review

  • New commits: 60a182e28 (drops the DCC-with-FMASK decode case), 1c1de3695 (adds the test that removes either plane of an EQAA target), and 3e3ddc10c (collectFmaskWrites, called before every stampUse of an EQAA target). Also merges of main up to 086c0686c8 (8efaff36c, 8bc11fae3). The last merge adapts the PR to #8223's TargetUse guards, #6628's guarded-range generation, and guardedColorBytes moving.
  • The description's What and Tested sections are updated for these. The author's comments of 2026-10-29 and 2026-10-30 explain the changes.

What I ran

  • Head 8bc11fae31b0ef03e768e14938cd5b6036f8d57b, main 04a9eb4fa2877eb6e40bf2c83adf972e40d89b24, merged tree 3440987aaccb56783b07dd403c97d9c71265210d.
  • Machine: Debian 13 VM (32 vCPU, Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6). The script built the merged tree and ran the selected tests and the validation-layer comparison.
git diff --check 04a9eb4fa2877eb6e40bf2c83adf972e40d89b24...8bc11fae31b0ef03e768e14938cd5b6036f8d57b
python3 tools/check_conventions.py --base 04a9eb4fa2877eb6e40bf2c83adf972e40d89b24
# negative control 1: State.hpp, State.cpp, MultisampleTarget.cpp from main
ninja -C build agc_driver_eqaa_color_target_tests
ctest --test-dir build --output-on-failure -R '^agc_driver_eqaa_color_target$'
# negative control 2: merged tree, collectFmaskWrites made to return at once (3e3ddc10c undone)
# negative control 3: merged tree, retireUnmapped second pass back to `range.metadataValid && !range.active->load(...)`
# (same build and ctest for both)
# restore the merged files, then:
ninja -C build agc_driver_eqaa_color_target_tests agc_driver_graphics_tests
ctest --test-dir build -j8 --output-on-failure -R '^(agc_driver_eqaa_color_target|agc_multisample_guest_access|agc_driver_multisample_retirement|agc_driver_native_fmask|agc_driver_fmask_image_reads)$'
git status --porcelain
Check Result
Merge into main 04a9eb4fa Clean
git diff --check Clean
check_conventions.py 0 errors, 1 warning (see the non-blocking finding below)
Build, libs OK
Selected tests (2241 run by the script) No new failures and no timeouts. All 7 failures also fail on the main baseline. agc_driver_eqaa_color_target, agc_driver_graphics, agc_multisample_guest_access and agc_driver_multisample_retirement pass
Validation layer (784 tests, layer loaded in 783, missing in none) No new VUID- line in any test this PR touches. The only test flagged is agc_driver_image_gather_volume: its sampler address-mode VUIDs are marked "test not run on main", and this PR changes no sampler code
Focused rerun after restoring the files 5/5 passed
Worktree after the controls git status --porcelain empty
Negative controls
# 1: production files from main
AGC graphics: color targets with more than one but fewer fragments than samples (EQAA) are unsupported
# 2: collectFmaskWrites disabled
AGC graphics: a read of the EQAA target's FMASK was not refused by name:
# 3: old retireUnmapped second pass
AGC graphics: removing only the FMASK allocation of an EQAA target left its color plane guarded

All three match the controls the author reports in the description.

Previous findings

  • Blocking — conflict with main in docs/dev/debt/libSceAgcDriver.md: Resolved. The PR merges cleanly into 04a9eb4fa. The merged tree builds and passes the selected tests, as shown above.
  • Non-blocking — retireUnmapped change had no test: Resolved. 1c1de3695 covers both directions (EqaaColorTarget.cpp L299 and L312). With the old second pass restored, the test fails (control 3).
  • Non-blocking — DCC refusal case still in the decode test: Resolved. 60a182e28 removes it, and no DCC case is left in eqaaColorTargetTests. The production Require stays, as I suggested.
  • Non-blocking — debt entry length: Resolved for the entry I named. Multisampled target guest access is now main's text unchanged, and the fragment-count detail is in the EQAA color targets entry. A different entry now trips the same warning (see below).

New findings

Blocking

None.

Non-blocking

  1. Multisampled color targets debt entry is over 1000 characters. check_conventions.py warns at docs/dev/debt/libSceAgcDriver.md:148: 1061 characters. On main the entry is just under the limit. This PR's added clause ", the color plane or an EQAA target's FMASK plane, ... with every guard" pushes it over (head L147). Suggested fix: keep this entry as "An unmap or allocation removal of a whole guarded range also retires it with every guard". Then add "either plane's unmap retires both" to the EQAA color targets entry, which already lists the FMASK plane.

I reviewed 3e3ddc10c itself:

  • collectFmaskWrites only advances the FMASK plane's write generation before stampUse stores the use generation. CollectWrites stamps generations and does not consume writes, so it hides nothing from other consumers of that range.
  • It runs on all three stamp paths: guard, holdHostOnly and the reuse path of acquire (L997-L1001).
  • The broader retireUnmapped erase (L978) feeds #6628's generation bump.

Not verified

  • Hardware GPUs. The script ran the GPU tests on lavapipe only. The RTX 4090 runs with the validation layer are as the author reports them; the NVIDIA runs are from TechLevelZero's CI comments.
  • agc_driver_graphics took 35.0 s here, over the 30 s rule. TechLevelZero's CI reported 36.6 s on an earlier head too. This PR only adds a few decode calls to it, and I did not time it on main, so I don't attribute this to the PR.
  • The FMASK Z_64KB_X footprint against console or addrlib output, and Gran Turismo 7 behaviour; I did not run any title.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5760341884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9700#pullrequestreview-5760341884). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T22:24:04Z. **Review:** APPROVED --- # Re-checked — approved The PR now merges cleanly with current `main`. Since 802f23b93 it drops the DCC-refusal test case, adds a regression for the `retireUnmapped` change, and adds a fix (3e3ddc10c) that collects FMASK-plane writes before each use stamp. On the merged tree the build passes, the focused tests pass, and three negative controls fail where they should. ## What changed since my last review - New commits: 60a182e28 (drops the DCC-with-FMASK decode case), 1c1de3695 (adds the test that removes either plane of an EQAA target), and 3e3ddc10c (`collectFmaskWrites`, called before every `stampUse` of an EQAA target). Also merges of `main` up to 086c0686c8 (8efaff36c, 8bc11fae3). The last merge adapts the PR to #8223's `TargetUse` guards, #6628's guarded-range generation, and `guardedColorBytes` moving. - The description's What and Tested sections are updated for these. The author's comments of 2026-10-29 and 2026-10-30 explain the changes. ## What I ran - Head `8bc11fae31b0ef03e768e14938cd5b6036f8d57b`, `main` `04a9eb4fa2877eb6e40bf2c83adf972e40d89b24`, merged tree `3440987aaccb56783b07dd403c97d9c71265210d`. - Machine: Debian 13 VM (32 vCPU, Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6). The script built the merged tree and ran the selected tests and the validation-layer comparison. ```sh git diff --check 04a9eb4fa2877eb6e40bf2c83adf972e40d89b24...8bc11fae31b0ef03e768e14938cd5b6036f8d57b python3 tools/check_conventions.py --base 04a9eb4fa2877eb6e40bf2c83adf972e40d89b24 # negative control 1: State.hpp, State.cpp, MultisampleTarget.cpp from main ninja -C build agc_driver_eqaa_color_target_tests ctest --test-dir build --output-on-failure -R '^agc_driver_eqaa_color_target$' # negative control 2: merged tree, collectFmaskWrites made to return at once (3e3ddc10c undone) # negative control 3: merged tree, retireUnmapped second pass back to `range.metadataValid && !range.active->load(...)` # (same build and ctest for both) # restore the merged files, then: ninja -C build agc_driver_eqaa_color_target_tests agc_driver_graphics_tests ctest --test-dir build -j8 --output-on-failure -R '^(agc_driver_eqaa_color_target|agc_multisample_guest_access|agc_driver_multisample_retirement|agc_driver_native_fmask|agc_driver_fmask_image_reads)$' git status --porcelain ``` | Check | Result | |---|---| | Merge into `main` 04a9eb4fa | Clean | | `git diff --check` | Clean | | `check_conventions.py` | 0 errors, 1 warning (see the non-blocking finding below) | | Build, `libs` | OK | | Selected tests (2241 run by the script) | No new failures and no timeouts. All 7 failures also fail on the `main` baseline. `agc_driver_eqaa_color_target`, `agc_driver_graphics`, `agc_multisample_guest_access` and `agc_driver_multisample_retirement` pass | | Validation layer (784 tests, layer loaded in 783, missing in none) | No new `VUID-` line in any test this PR touches. The only test flagged is `agc_driver_image_gather_volume`: its sampler address-mode VUIDs are marked "test not run on main", and this PR changes no sampler code | | Focused rerun after restoring the files | 5/5 passed | | Worktree after the controls | `git status --porcelain` empty | <details><summary>Negative controls</summary> ``` # 1: production files from main AGC graphics: color targets with more than one but fewer fragments than samples (EQAA) are unsupported # 2: collectFmaskWrites disabled AGC graphics: a read of the EQAA target's FMASK was not refused by name: # 3: old retireUnmapped second pass AGC graphics: removing only the FMASK allocation of an EQAA target left its color plane guarded ``` </details> All three match the controls the author reports in the description. ## Previous findings - **Blocking — conflict with `main` in `docs/dev/debt/libSceAgcDriver.md`: Resolved.** The PR merges cleanly into 04a9eb4fa. The merged tree builds and passes the selected tests, as shown above. - **Non-blocking — `retireUnmapped` change had no test: Resolved.** 1c1de3695 covers both directions ([EqaaColorTarget.cpp L299 and L312](https://github.com/boykopovar/AnyPS5/blob/8bc11fae31b0ef03e768e14938cd5b6036f8d57b/core/libs/prx/libSceAgcDriver/tests/execution/EqaaColorTarget.cpp#L290-L312)). With the old second pass restored, the test fails (control 3). - **Non-blocking — DCC refusal case still in the decode test: Resolved.** 60a182e28 removes it, and no DCC case is left in `eqaaColorTargetTests`. The production `Require` stays, as I suggested. - **Non-blocking — debt entry length: Resolved for the entry I named.** `Multisampled target guest access` is now `main`'s text unchanged, and the fragment-count detail is in the `EQAA color targets` entry. A different entry now trips the same warning (see below). ## New findings ### Blocking None. ### Non-blocking 1. **`Multisampled color targets` debt entry is over 1000 characters.** `check_conventions.py` warns at `docs/dev/debt/libSceAgcDriver.md:148`: 1061 characters. On `main` the entry is just under the limit. This PR's added clause ", the color plane or an EQAA target's FMASK plane, ... with every guard" pushes it over ([head L147](https://github.com/boykopovar/AnyPS5/blob/8bc11fae31b0ef03e768e14938cd5b6036f8d57b/docs/dev/debt/libSceAgcDriver.md#L147-L147)). Suggested fix: keep this entry as "An unmap or allocation removal of a whole guarded range also retires it with every guard". Then add "either plane's unmap retires both" to the `EQAA color targets` entry, which already lists the FMASK plane. I reviewed 3e3ddc10c itself: - `collectFmaskWrites` only advances the FMASK plane's write generation before `stampUse` stores the use generation. `CollectWrites` stamps generations and does not consume writes, so it hides nothing from other consumers of that range. - It runs on all three stamp paths: `guard`, `holdHostOnly` and the reuse path of `acquire` ([L997-L1001](https://github.com/boykopovar/AnyPS5/blob/8bc11fae31b0ef03e768e14938cd5b6036f8d57b/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L997-L1001)). - The broader `retireUnmapped` erase ([L978](https://github.com/boykopovar/AnyPS5/blob/8bc11fae31b0ef03e768e14938cd5b6036f8d57b/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L978-L978)) feeds #6628's generation bump. ## Not verified - Hardware GPUs. The script ran the GPU tests on lavapipe only. The RTX 4090 runs with the validation layer are as the author reports them; the NVIDIA runs are from TechLevelZero's CI comments. - `agc_driver_graphics` took 35.0 s here, over the 30 s rule. TechLevelZero's CI reported 36.6 s on an earlier head too. This PR only adds a few decode calls to it, and I did not time it on `main`, so I don't attribute this to the PR. - The FMASK `Z_64KB_X` footprint against console or addrlib output, and Gran Turismo 7 behaviour; I did not run any title. <!-- anyps5-bots job=3647 head=8bc11fae31b0ef03e768e14938cd5b6036f8d57b -->
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!9700
No description provided.