fix(agc): journal the mesh output primitive size #6784
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6784"
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 milescoviello on 2026-10-16T11:39:45Z.
What
main65d56a297does not build on Linux with libstdc++ (GCC 13.3 here).PipelineJournal.cppstops on its own layout guards:#5884 added
MeshConfiguration::outputPrimitiveSize, and #5875 guards the sizes of the structs its recipe codec encodes. The two merged separately.MeshConfigurationis now 40 bytes, andShaderStages, which holds an optional one, is 112. The codec also didn't write the new field, so a replayed line-strip geometry pipeline would come back with the default of 3.How
encodeMeshanddecodeMeshwrite and readoutputPrimitiveSizeafteresgsItemSize.mainafter #5884 wrote journals whose mesh records lack the field, under the new shader-cache source version. Those are now discarded instead of being read with the new codec. MarcZX100 pointed this out.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.
agc_pipeline_journal(agc_driver_graphics_tests --pipeline-journal): new case. A recipe for a mesh stage withoutputPrimitiveSize2 must decode with 2. With the guards fixed but the codec as onmain, it fails 3 of 3 withthe recipe dropped the mesh output primitive size. With this change it passes 3 of 3, as doesagc_driver_pipeline_journal.a journal in format 2, whose mesh records lack the output primitive size, was loaded. With 3 it passes 3 of 3.main65d56a297the library doesn't compile, so nothing above runs there.agc_driver_graphicsfails here 3 of 3 withShaderRecompiler::Recompile: VOP2 opcode is not implemented. It passed 3 of 3 on this change atmainaff725bf6, before #5804 merged, so it is in a case #5804 added. The request it dumps is a 12-word vertex program whose code words are all zero, the same length as #5804'svertexBdaCode. I haven't found why; that should be a separate fix.Not checked on Windows, macOS, on AMD or on a console.
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)main🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:41:09Z.
Review: CHANGES_REQUESTED
The journal codec changes, but
FileFormatremains 2. A journal written by main after #5884 can already carry the newShaderDiskCache::SourceVersion()(the recompiler source hash includes the new mesh field) while still using the oldencodeMeshlayout.PipelineJournal.cppis not part of that source-version hash, so this new decoder accepts that old journal header and then reads the addedoutputPrimitiveSizefrom the following field(s). Please bump the journal format (or add an equivalent codec-version discriminator) and add a regression showing that a journal written with the old mesh record is discarded, rather than parsed with the new codec.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T11:45:46Z.
Thanks, you're right. The guards only build on Linux with libstdc++, so Windows and macOS builds of
mainafter #5884 compiled and could write journals with the new source version and the old mesh records. My note in the description was wrong for those.2d5f761cbbumps the journal format to 3. The journal test now rewrites a recorded journal's header to format 2 and requires the replay to load no module and no recipe. With the format left at 2 it fails 3 of 3 (a journal in format 2, whose mesh records lack the output primitive size, was loaded), and with 3 it passes 3 of 3. I've updated the description.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T11:47:21Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:48:07Z.
Review: APPROVED
The format-3 bump closes the compatibility gap: old format-2 journals are discarded even when their shader source version matches, and the regression checks that replay loads neither recipes nor modules. The mesh round-trip test also checks
outputPrimitiveSizealongside the neighboring field. Eligibility, conventions and report checks pass; the required relinker/platform jobs are skipped for this path. The focused runtime results are reported in the PR body. I found no remaining issue in the requested change.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T12:18:50Z.
Independent confirmation: unmodified main65's
PipelineJournal.cppfails theShaderStagesandMeshConfigurationguards on Ubuntu24.04/GCC13.3. Your2d5f761cbcorrection unblocks those in our retained integration5e69b9642. Its codec implementation differs from your head only in the integration-onlyStatesize guard (768): extra runtime color metadata is explicitly excluded from the canonical recipe/key by a new test.On that adapted pin, CPU journal tests pass3/3 on Windows and Linux, including the line-strip field and format-2 rejection assertions. GPU journal tests pass3/3 each on NVIDIA RTX5080 (610.62/32.0.16.1062), AMD Radeon Graphics (32.0.21036.18), Windows11 Enterprise26200 / WinLibs GCC15.2r7, and Linux Mesa25.2.8 llvmpipe. Physical/software identity is verified per GPU process. Affected libraries/targets build; this is not an exact-head full-suite claim.
The separate CPU graphics error you noted reproduces3/3 on unmodified post-merge main
eb901bcf4; journal control3/3 passes. I filed #6792 with exact commands and the identical serialized zero-word vertex request, keeping that investigation separate from this codec correction. AI-assisted: Codex.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T12:22:07Z.
Thanks for checking it across the four devices. The
agc_driver_graphicsfailure you filed as #6792 comes from #5804's vertex terminate case: its request's code span sees 12 zero words. #6789 makes that case'svertexBdaCodearraystatic constexpr. With it, the whole test passes 3 of 3 here, and it fails 3 of 3 without.AI-assisted: yes