feat(agc): implement sceAgcUpdateInterpolantMapping_0100 #10736
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10736"
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 akkadbakkad89 on 2026-10-24T20:07:59Z.
What
Implements
sceAgcUpdateInterpolantMapping_0100(NIDk0E7vkgqAuE), the 01.00-era VS→PS interpolant-mapping update, replacing theNotImplementedstub inMisc/src/ShaderFusion.cpp. GTA: Vice City (PPSA03530) imports it vialibSceJobManager.prx(import audit).Derived from the decrypted 4.03
libSceAgc.sprx(function at0xe1c0, 0x242 bytes): a pure per-input compute loop overps->num_input_semantics— matchesvsoutput semantics by semantic id, builds the register value and writesregs[i]. Unlike the_10000/unversioned family it resolves no shader ABI, runs no preparation transaction and writes no identity tail — with zero inputs it returns without touching the registers, matching firmware.CreateInterpolantValue;_0100writes the semanticdefault_valuebits through unchanged — the same identity encoding as the unversioned update (0x28bd4),create_0100(0x28bf4) and the existing helpers. An earlier read of the0x28c14table as a {0,2,1,3} swap was wrong for this path: the OpenAGC vectors recorded in #3364 for siblingvieBRwlh1Lw(0x625,0x01380107,0x02480220,0x03680709) run through_0100to those exact values only under identity.Tested
Windows 11, MinGW GCC 15.2.0, Release:
ctest --test-dir build -R agc_interpolant_mapping -Vpasses identically onorigin/main(9def985463) and on this head (57fdba2564). The suite is CPU-only mapping math — no Vulkan device is created, soVK_LAYER_KHRONOS_validationnever engages;ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_PATHwere set on both runs anyway, and neither log containswas not found but was requestedor aVUID-line. The suite gainstestUpdate0100Mapping: the values above, register offsetsSPI_PS_INPUT_CNTL_0 + i, no writes past the input count, the zero-inputs early return, zero ABI/preparation calls, and rejection coverage.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.mdfiles or images added to the repository (attach them to this PR)agc_interpolant_mappingcreates no Vulkan deviceImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T20:16:05Z.
Review: COMMENTED
Reviewed head
f76516dfb0f6c39b59177b8b5f5f76148ab09482. The new_0100update path is separate from the newer ABI-preparing paths, bounds the input count before writing, leaves registers untouched for zero inputs, and the added CPU tests exercise all four default-value encodings, matched/unmatched semantics, output bounds and the no-ABI side effect. The firmware measurements and cross-check against the sibling mapping vectors are useful evidence. Two review gaps remain before I can approve: (1) the implementation and test files are CRLF whilemainis LF, making the diff show hundreds of unchanged lines; please normalize those files to LF so the behavioral changes are reviewable. (2) CONTRIBUTING requires the focused test comparison onmainand the change withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer. The PR reports one Windows run on the change, and does not include the cache control or a baseline result. Since this test does not create a Vulkan device, please clarify which controls are meaningful and report the exact baseline/current results (or explain why a baseline cannot run against the existing stub). I have not approved pending those points.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T04:58:13Z.
Review: APPROVED
Reviewed — looks good
The CPU-side export, boundary behavior, and focused test coverage are consistent with the implementation evidence, and the previously raised diff-format and validation questions have been answered.
What I ran
21848798ab7dfb954e51fde62421a1ce528febc1.mainat52c09d567d2fa453494dd720fcf53a98149468e4; the PR merge preview was clean against the then-current base reported during this review.Results
Raw command and check output
Negative control
Findings
Blocking
None found in the reviewed diff.
Non-blocking
Sources
21848798ab7dfb954e51fde62421a1ce528febc121848798ab7dfb954e51fde62421a1ce528febc1Not verified
To get this to a good state
No further action is needed for this review. I would rerun the same focused build and test commands on a local or hosted Linux builder when practical.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T05:21:22Z.
Review: APPROVED
Reviewed — approved
The new
sceAgcUpdateInterpolantMapping_0100merges cleanly, builds, exports fromlibSceAgc.prx, and passes its focused test on Linux. Both negative controls fail as they should, and I found nothing blocking.What I ran
21848798ab7dfb954e51fde62421a1ce528febc1main:52c09d567d2fa453494dd720fcf53a98149468e4mainwith the PR merged in (git merge --no-ff, clean;docs/dev/debt/libSceAgc.mdauto-merged), in a clean worktreeResults
maingit diff --checktools/check_conventions.py --base origin/mainAll conventions checks passed.test_public_headers.py --audit-only373 libraries, 13414 exports: unique declarations and umbrella coverage verifiedagc_interpolant_mapping_tests,libSceAgcsceAgcUpdateInterpolantMapping_0100is defined (T) inlibSceAgc.prxagc_interpolant_mapping, merged treeagc_interpolant_mapping,mainpublic_headers*(65 tests), merged treeVUID-lines /was not found but was requested by env var VK_INSTANCE_LAYERSFocused test output (merged tree)
Focused test output (main)
Negative control
Misc/include/ShaderFusion.hpp,Misc/src/ShaderFusion.cpp,Shader/include/InterpolantMapping.hpp,Shader/src/InterpolantMapping.cpp) frommainand kept the new test. The test target then fails to compile, becausesceAgcUpdateInterpolantMapping_0100is not declared attests/InterpolantMapping.cpp:171,:221,:285and:295._0100table inApplyInterpolantDefaultValue0100from{0, 2, 1, 3}to identity{0, 1, 2, 3}, which makes it encode like the shared helper. The test then fails with_0100 update does not encode default value 2 as 1. The new assertions do pin the versioned encoding.I restored the files and rebuilt after each control.
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgc/tests/InterpolantMapping.cpp:295-303(at head): the sibling exports build their values in a localvaluesarray and copy them out only after validation. The new export writes straight into the caller'sregs(InterpolantMapping.cpp:134-163). That is correct today, because every check runs before the write loop. However, nothing tests that the rejections in this block leaveregsalone: thememcmpagainstsavedcomes before them, and only the first_0100call (the >32 case) falls under it. A later change that moves a check into the loop would write a partial mapping and then throw, and no test would catch it. Suggested fix: repeatcheck(std::memcmp(regs.data(), saved.data(), sizeof(regs)) == 0, ...)after line 303.Not verified
libSceAgc.sprxhere, so I could not check the firmware facts myself: the{0,2,1,3}table at0x28c14fordefault_value, and the claim that the update leavesdefault_value_hi(bits 22:21) as identity. The test fixes both: the swap viaregs[0]/regs[1], and the unswapped hi default viaregs[2] == 0x02580020uattests/InterpolantMapping.cpp:194. Both are therefore exactly as reliable as that disassembly.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T16:59:24Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The earlier approval was on the incorrect swapped mapping; this head corrects the code to identity, but the PR description still describes the old mapping as firmware behavior.
What I ran
Reviewed head
c2716650a9d3c7d202055da2eef0eb9e403c149eagainst the PR base086ec0a79d82f35ab26769fcb55e660c9796751c; the current-main merge preview is clean against474030e58424fefdb65e5df9f3820810fbb4553c. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. I did not invoke a compiler or build locally.I also inspected the full head diff, the current PR description, the author’s correction, the updated expected values, and the current-main merge preview.
Results
k0E7vkgqAuEmatches the export name. The lexical audit does not prove binary ABI correctness.474030e58424fefdb65e5df9f3820810fbb4553c; no declared dependency remainsagc_interpolant_mappingtest passed 3/3 on this head; I did not run it locallymain73f4f7e; report says build passed, 1,062 tests passed, two failures also occur on main, nine skipped, and no new Vulkan validation IDs. This is corroborating evidence, not a run against today’smain.Unedited local check output
Conventions stdout:
Filtered ABI audit output:
Hosted-check command output:
The precheck’s ABI and test-quality helpers could not run from its isolated checkout because the helper scripts were absent there; I ran the ABI audit directly above and inspected the tests manually. The precheck recorded diff, conventions, and mergeability as passed.
Findings
Blocking
The PR description still says the 4.03
default_valuetable maps{0,1,2,3}to{0,2,1,3}and that the reported vectors demonstrate a 1↔2 swap. The current implementation instead applies(psWord >> 28) & 3directly to bits 9:8, and the updated regression assertions expect identity values (default_value2 remains 2; 1 remains 1). The author’s latest correction also says the jump-table case addresses were mistaken for index order and that the 4.03 mapping is identity. Please update the description’s mapping and cross-check bullets to describe identity and remove the now-false swap claim. The code and tests appear consistent with that correction; no further code edit is requested here.Non-blocking
None found in the reviewed code diff.
Sources
Not verified
main; I only verified the current-head merge preview, not a new baseline run.To get this to a good state
Correct the PR description’s mapping and vector explanation so they agree with the identity implementation and current test expectations. I will rerun the same checks on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T21:35:19Z.
Review: APPROVED
Re-checked — new head, looks good
The previous blocker is resolved: the description now reports identity encoding, matching the implementation and the updated expected values.
What I ran
Reviewed exact head
57fdba256432d64f80e5b3e147b13c8ce9546585against PR basea98f9b6282f903ae9985df871ba5192f6569ed9b; the current-main merge preview is clean. The author’s baseline run usedmain9def985463; I confirmed the intervening commits to the current base did not change files undercore/libs/prx/libSceAgc/. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. I did not build or run CTest locally.Results
k0E7vkgqAuEmatches the export.agc_interpolant_mappingpassed on bothmain9def985463and this exact head, with the Vulkan environment controls set. This CPU-only test creates no Vulkan instance; I did not independently rerun it.Selected raw output
Findings
Blocking
None found in the exact-head diff.
Non-blocking
The focused test and firmware disassembly evidence are author-reported; I did not independently run the test or inspect a console module.
Sources
_0100expected values and bounds assertionsNot verified
I did not build locally, rerun CTest, inspect the PS5 module, or independently verify console behavior. The hosted Windows job was still running; Linux and specialized jobs were skipped.
To get this to a good state
No code change is needed based on this review. I will re-check the same focused evidence if the head changes.