Repository navigation
test(agc): map the GCN color slices below 40 bits in an ASan build - #28194
Conversation
Based on boykopovar#17680 by StepFPV. Co-Authored-By: StepFPV <StepFPV@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three agc graphics tests pass under ASan once the GCN color slices map below 1 << 40, so the known-failures list is empty. The repository check now only requires the list to parse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the review evidence supports merging.
What I ran
Reviewed head 6fc23c57ac739769aa22a500c800144af0311924 against the prepared diff. No commands or tests were run; the PR description reports sanitizer and Python test runs, but those results were not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted code review | passed | Reviewed the changed logic and its parser behavior. |
| Tests in this review | not run | Author-reported results only. |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Read .github/sanitizer-known-failures.txt, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp (including the changed function and its platform includes), and tools/tests/test_sanitizer_report.py (including the changed test). The full text of Graphics.cpp was excluded from the review folder because it was too large; only targeted ranges were read through repo_read.py. files.json was not available through the reader. I did not run the reported sanitizer tests or Python unittest command, inspect CI output, or verify behavior on other operating systems.
To get this to a good state
Nothing is required.
|
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.
|
|
Windows + NVIDIA result for head Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, Validation-layer protocol on
No new validation errors and no test failures on this PR's tree. The tests this PR adds or changes ( AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
ligmaSec
left a comment
There was a problem hiding this comment.
The exact sanitizer-report tests passed all 44 cases on Linux. A separate ASan allocation check using the fixture's mapping loop placed the 48 KiB slice allocation at 0x60000000 and wrote to it successfully. The integrated ASan graphics fixture still needs coverage.
Can the loop distinguish occupied addresses from an unavailable mapping operation? It currently retries every error to the 40-bit ceiling. An error that will repeat for every address can turn a clear test failure into a timeout across roughly 268 million calls.
AI-assisted: yes.
… occupied address MAP_FIXED_NOREPLACE reports an occupied range as EEXIST. Any other error repeats at every address, so the loop retried it up to the 40-bit ceiling, about 268 million calls, and a clear failure became a timeout. The loop now moves on only past EEXIST and names the other case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ligmaSec good catch, fixed in d5b3569. With AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed changes correctly map the ASan test slices below the 40-bit limit and allow an empty known-failures file.
What I ran
Reviewed head d5b3569f4dfea4b6549c0a7685371d45e5206310 using repo_read.py to inspect the changed code and targeted source context. No tests or builds were run; the CI results in the PR description are author-reported.
Files read: .github/sanitizer-known-failures.txt (deletion shown in the diff), core/libs/prx/libSceAgcDriver/tests/Graphics.cpp (all changed lines and the surrounding test), and tools/tests/test_sanitizer_report.py (changed line and related tests). No files were excluded by review rules.
Results
| Check | Result | Note |
|---|---|---|
| Changed-line review | passed | All changed lines inspected |
| Tests and builds | not run | CI results are author-reported |
Negative control
Not run; no test was changed to confirm it fails under a deliberately introduced defect.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The reported sanitizer workflow and Python test run were not independently confirmed. Runtime behavior on other hosts was not tested.
To get this to a good state
No required follow-up.
ligmaSec
left a comment
There was a problem hiding this comment.
The revised loop retries only an occupied address and stops on other mapping errors. I exercised the exact loop under Linux ASan with the first hint occupied. It advanced to the next page, mapped the full 48 KiB below the 40-bit ceiling, and the test wrote through the mapping successfully. This was an isolated allocation check.
AI-assisted: yes.
|
Retested head Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, Validation-layer protocol on
The tests this PR adds or changes ( AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
What
The nightly sanitizer run lists
agc_driver_graphics,agc_driver_graphics_maps_fallbackandagc_graphics_profile_drawas known failures. All three stop on the same check ingcnColorSliceTests(). Under ASan,GuestArena.hppmoves the guest arena to0x100000000000, above 1 << 40. The GCN color-buffer base in0x318 << 8has only 40 bits, so a guest heap block cannot be encoded.In an ASan build, the test now maps its three 64x64 slices itself with
MAP_FIXED_NOREPLACEat the first free page below 1 << 40, and unmaps them afterwards. Other builds keep the guest heap block. The decode under test does not change.With the three tests passing,
.github/sanitizer-known-failures.txtis now empty. The repository test that parses the file now accepts an empty list.Based on #17680 by @StepFPV, which its author closed. Its
DepthSurfaceReusepart is already onmain, and this PR carries over only the slice mapping. Refs #16813.Tested
sanitizers.ymlsetup) on the fork: run 46209269345. The three tests passed:agc_driver_graphics_maps_fallbackin 237.64 s,agc_driver_graphicsin 280.69 s andagc_graphics_profile_drawin 297.13 s. For speed, that run built onlyagc_driver_graphics_testsand ran only these three tests.python -m unittest tools/tests/test_sanitizer_report.py: 44 tests OK.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)Summary by CodeRabbit