agc_command_tests full mode fails on main: stale 32-bit WriteWait expectation #1005

Closed
opened 2026-10-06 22:54:59 +00:00 by hugodearaujo · 2 comments
hugodearaujo commented 2026-10-06 22:54:59 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T22:54:59Z.


agc_command_tests is registered in ctest only as agc_initialization (agc_command_tests defaults). Run without arguments on main (09f87823), it fails:

$ ./build/tests/agc_command_tests
expected an exception

The failing case is in testMemory in core/libs/prx/libSceAgc/tests/Commands.cpp (line 335):

expectFailure([&] { Agc::Command::WriteWait(&storage.buffer, 0, 3, 0, 0, &value, 0x100000000ull, 0, 32, __func__); });

It expects a 32-bit wait (size 0) with a reference above 32 bits to throw. Since 9c2a7560 (#5, "relaxed checks for what titles send"), WriteWait truncates the reference and mask of a 32-bit wait instead:

// 32-bit waits only use the low halves; guests commonly pass a full 64-bit mask.
reference &= 0xffffffffu;
mask &= 0xffffffffu;

With that line commented out, the full mode passes ("AGC command tests passed"), so this is the only stale expectation. The test was not updated because the full mode is not run by ctest.

Two possible fixes:

  • update the expectation to the truncating behaviour (the packet keeps the low halves);
  • register the full mode in ctest too, so the other cases (packets, markers, flip, registers, memory) are checked again.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5736489574 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1005). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-06T22:54:59Z. --- `agc_command_tests` is registered in ctest only as `agc_initialization` (`agc_command_tests defaults`). Run without arguments on `main` (09f87823), it fails: ``` $ ./build/tests/agc_command_tests expected an exception ``` The failing case is in `testMemory` in `core/libs/prx/libSceAgc/tests/Commands.cpp` (line 335): ```cpp expectFailure([&] { Agc::Command::WriteWait(&storage.buffer, 0, 3, 0, 0, &value, 0x100000000ull, 0, 32, __func__); }); ``` It expects a 32-bit wait (`size` 0) with a reference above 32 bits to throw. Since 9c2a7560 (#5, "relaxed checks for what titles send"), `WriteWait` truncates the reference and mask of a 32-bit wait instead: ```cpp // 32-bit waits only use the low halves; guests commonly pass a full 64-bit mask. reference &= 0xffffffffu; mask &= 0xffffffffu; ``` With that line commented out, the full mode passes ("AGC command tests passed"), so this is the only stale expectation. The test was not updated because the full mode is not run by ctest. Two possible fixes: - update the expectation to the truncating behaviour (the packet keeps the low halves); - register the full mode in ctest too, so the other cases (packets, markers, flip, registers, memory) are checked again.
Dextroid17 commented 2026-10-06 22:59:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-06T22:59:04Z.


Sent a PR for this that does both: the expectation now asserts the truncating behaviour (the packet keeps the low halves), and the full mode is registered as agc_commands so the other cases run again. Verified AGC command tests passed and 370/370 ctest. @hugodearaujo if you are already on it, say so and I will close mine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026988490 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1005#issuecomment-6026988490). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-06T22:59:04Z. --- Sent a PR for this that does both: the expectation now asserts the truncating behaviour (the packet keeps the low halves), and the full mode is registered as `agc_commands` so the other cases run again. Verified `AGC command tests passed` and 370/370 ctest. @hugodearaujo if you are already on it, say so and I will close mine.
hugodearaujo commented 2026-10-06 23:15:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T23:15:53Z.


Not working on it, thanks for picking it up. I built #1006 locally: the full mode now passes, agc_initialization and agc_commands both pass, and the whole suite is 370/370 here too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027185933 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1005#issuecomment-6027185933). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-06T23:15:53Z. --- Not working on it, thanks for picking it up. I built #1006 locally: the full mode now passes, `agc_initialization` and `agc_commands` both pass, and the whole suite is 370/370 here too.
Sign in to join this conversation.
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#1005
No description provided.