AnyPS5/core/libs/prx/libSceAgc/tests
fdfawef324 f8257a112b feat(agc): return null from the workload builders for unregistered streams
sceAgcDcbSetWorkloadStreamInactive and the three ACB workload builders
(sceAgcAcbSetWorkloadsActive, sceAgcAcbSetWorkloadComplete,
sceAgcAcbSetWorkloadStreamInactive) threw for every call, and
sceAgcDcbSetWorkloadsActive read the workload ids before it checked the
stream.

The prosper console oracle (mattias800/prosper df074498,
prosper/tests/data/console_oracle/agcbuild.golden.tsv lines 48-56 and
196-204) measured all six calls on a PS5 with three argument patterns
and no workload stream registered: each returned null and wrote nothing.
Pattern b passes stream 1 with the workload ids at address 2, so the
console checks the stream before it reads the ids; here that call read
address 2 and crashed.

The four builders now return null for a null command buffer or a stream
that is not registered, and still throw for a registered stream: the
packet a registered stream gets is not measured, KytyPS5 has no body for
them, and its IT_NOP layout for the DCB calls differs from the
SET_UCONFIG_REG, WRITE_DATA and SET_WORKLOAD sequence OpenAGC
(3c7e8072, src/agc_workload_packet.c) derives from the driver. The
signatures are OpenAGC's DCB ones (src/game_compat.c), which says the
ACB calls use the same driver builders. sceAgcDcbSetWorkloadsActive now
checks the stream before the ids, as OpenAGC does. Recorded in
docs/dev/debt/libSceAgc.md.

agc_commands gains testWorkloadStreams: the three measured patterns for
all six calls (null, buffer untouched), an exhausted and a null buffer,
and a registered stream that throws without touching the buffer. On
upstream/main it fails with "sceAgcDcbSetWorkloadStreamInactive not
implemented", and the DCB active pattern b alone segfaults reading
0x2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:22:21 -04:00
..
BranchPatch.cpp feat(agc): implement sceAgcBranchPatchSetThenTarget_0300 and SetElseTarget_0300 2026-10-10 15:05:43 -05:00
CbCondWrite.cpp feat(libSceAgc): implement sceAgcCbCondWrite 2026-10-06 18:07:37 -03:00
Commands.cpp feat(agc): return null from the workload builders for unregistered streams 2026-10-12 15:22:21 -04:00
CondExecPatch.cpp feat(libSceAgc): implement the async COND_EXEC patches 2026-10-06 17:32:52 -03:00
ContextStateSize.cpp refactor(libSceAgc): name exports after the versioned SDK names their NIDs hash to 2026-10-07 13:55:45 -04:00
DmaData.cpp feat(agc): implement sceAgcAcbDmaDataGetSize 2026-10-04 18:12:38 +02:00
EndOfShaderActionSize.cpp feat(libSceAgc): implement sceAgcDcbQueueEndOfShaderActionGetSize 2026-10-06 20:38:14 -03:00
GsOversubscription.cpp feat(agc): implement sceAgcGetGsOversubscription 2026-10-06 01:16:35 +02:00
InterpolantMapping.cpp feat(libSceAgc): implement the vieBRwlh1Lw interpolant mapping update 2026-10-11 20:16:47 +03:00
PacketInfo.cpp feat(agc): implement sceAgcGetPacketSize 2026-10-06 00:50:27 +02:00
PayloadRange.cpp refactor(libSceAgc): name three more exports after their versioned NIDs 2026-10-07 14:02:51 -04:00
Platform.cpp fix(agc): store sceAgcGetIsTrinityMode's flag through its out pointer 2026-10-05 17:51:03 +02:00
Predication.cpp fix(agc): count the one-dword NOP pad as one dword in range predication 2026-10-05 14:49:17 -05:00
PrimeUtcl2.cpp feat(agc): implement sceAgcDcbPrimeUtcl2 and its size query 2026-10-05 10:05:28 +02:00
RegisterCommands.cpp fix(agc): ignore the count passed to the indirect register GetSize functions 2026-10-10 17:42:05 -05:00
ShaderFusion.cpp fix(tests): check Vulkan availability before shader registration 2026-10-08 19:09:13 +03:00
ShaderHelpers.cpp test(agc): cover hand-built VGPR register offset 2026-10-11 13:32:20 +00:00
WriteDataPatch.cpp test(libs): declare the write data patch function pointers with the guest ABI 2026-10-06 13:54:12 -05:00