feat(libcairo): implement seventeen context and CTM exports #15315

Merged
hyvvs merged 1 commit from upstream-pr/15315 into main 2026-11-09 12:15:16 +00:00
hyvvs commented 2026-11-02 23:29:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-02T23:29:08Z.


What

Implement 17 Cairo context and CTM exports, owned surface references, save/restore, and affine coordinate conversion. Merge sequence: #14327 -> #14328 -> #14329 -> #15315 -> #15317 -> #15324.

Tested

Windows MinGW C++20 -DNDEBUG DLL-linked guest PASS (8,192 lifetimes); Ubuntu WSL -DNDEBUG ASan+UBSan/leak check PASS; native Cairo1.18 4,096 CTM differential PASS; headers, progress and conventions PASS. Full integrated CMake/CTest and PS5 console not tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #14327, #14328, #14329 (coordinated Cairo merge order)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Detailed implementation and verification notes

Summary

Implement 17 formerly throwing libcairo exports: context create/reference/destroy, nested save/restore, borrowed target lookup, 11 user/device coordinate and CTM transformations.

The implementation owns a reference to the CairoSurface provided by #14327, tracks context refcounts and sticky error states, and uses the ten affine matrix primitives already merged via #14258. Save/restore manages the currently implemented CTM state, and inverse transforms use validated matrix inversion.

Validation

  • Windows MinGW GCC C++20 -O2 -Wall -Wextra -Werror -pedantic: real DLL/import-library and linked guest test PASS; 8192 context lifetime iterations.
  • Ubuntu WSL GCC C++20 ASan+UBSan with leak detection: guest test PASS; fixed a sticky-error-context lifetime leak found by this check.
  • Differential against native Cairo 1.18.0 dynamic library: 4096 randomized translate/scale/rotate/transform, set/get matrix, save/restore, forward/inverse coordinate and distance sequences PASS.
  • Public export-header audit: 405 libraries, 27906 declarations PASS.
  • Progress unit tests: 59 passed (one skipped); conventions --base upstream/main --head HEAD PASS; git diff --check PASS.
  • Cairo branch scanner: 29/161 before this change to 46/161, exactly +17.

Dependencies and scope

This PR is stacked on #14327 (19 image/surface exports) because cairo_create and cairo_destroy must retain/release those real surface objects. It currently includes the parent branch history; land #14327 first, then refresh this PR's base before merging. #14258 matrix primitives have already merged into main.

These exports are functional for context lifetimes and coordinate state, NOT full Cairo rendering. Path construction, clipping, pixels, rendering, other graphics-state fields, and PS5 firmware-specific behavior are not claimed. No console differential is available. Newly implemented exports are not counted as upstream coverage until merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5129100972 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15315). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-11-02T23:29:08Z. --- ### What Implement 17 Cairo context and CTM exports, owned surface references, save/restore, and affine coordinate conversion. Merge sequence: #14327 -> #14328 -> #14329 -> #15315 -> #15317 -> #15324. ### Tested Windows MinGW C++20 -DNDEBUG DLL-linked guest PASS (8,192 lifetimes); Ubuntu WSL -DNDEBUG ASan+UBSan/leak check PASS; native Cairo1.18 4,096 CTM differential PASS; headers, progress and conventions PASS. Full integrated CMake/CTest and PS5 console not tested. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #14327, #14328, #14329 (coordinated Cairo merge order) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes ### Detailed implementation and verification notes ## Summary Implement 17 formerly throwing libcairo exports: context create/reference/destroy, nested save/restore, borrowed target lookup, 11 user/device coordinate and CTM transformations. The implementation owns a reference to the CairoSurface provided by #14327, tracks context refcounts and sticky error states, and uses the ten affine matrix primitives already merged via #14258. Save/restore manages the currently implemented CTM state, and inverse transforms use validated matrix inversion. ## Validation - Windows MinGW GCC C++20 -O2 -Wall -Wextra -Werror -pedantic: real DLL/import-library and linked guest test PASS; 8192 context lifetime iterations. - Ubuntu WSL GCC C++20 ASan+UBSan with leak detection: guest test PASS; fixed a sticky-error-context lifetime leak found by this check. - Differential against native Cairo 1.18.0 dynamic library: 4096 randomized translate/scale/rotate/transform, set/get matrix, save/restore, forward/inverse coordinate and distance sequences PASS. - Public export-header audit: 405 libraries, 27906 declarations PASS. - Progress unit tests: 59 passed (one skipped); conventions --base upstream/main --head HEAD PASS; git diff --check PASS. - Cairo branch scanner: 29/161 before this change to 46/161, exactly +17. ## Dependencies and scope This PR is stacked on #14327 (19 image/surface exports) because cairo_create and cairo_destroy must retain/release those real surface objects. It currently includes the parent branch history; land #14327 first, then refresh this PR's base before merging. #14258 matrix primitives have already merged into main. These exports are functional for context lifetimes and coordinate state, NOT full Cairo rendering. Path construction, clipping, pixels, rendering, other graphics-state fields, and PS5 firmware-specific behavior are not claimed. No console differential is available. Newly implemented exports are not counted as upstream coverage until merged.
MarcZX10 commented 2026-11-02 23:41:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T23:41:00Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The new tests lose their runtime assertions in the repository’s Release configuration, and this head also fails the required PR-template and source-comment rules.

What I ran

Reviewed all 11 changed files at head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 against PR base 5cb015caaaaf83f8ee431414ee6a457b5b307d49. The head contains the open #14327 head as an ancestor and merges cleanly with current main. Pairwise previews against open #14328 and #14329 report conflicts in shared Cairo integration files. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not configure or build AnyPS5.

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...4563a8c6fbb9de7d88753dfcd3dc958abae31ea4
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --json > /tmp/anyps5-pr-precheck/15315-abi.json
python3 -c 'import json; d=json.load(open("/tmp/anyps5-pr-precheck/15315-abi.json")); print(json.dumps({"status":d.get("status"),"symbol_count":len(d.get("symbols",[])),"finding_count":len(d.get("findings",[]))},indent=2))'
printf '#include <cassert>\nassert(false);\n' | c++ -DNDEBUG -E -P -x c++ - | tail -2
git merge-tree --write-tree 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 4693e20f3e04b5b81d65e98d09ed661ec96a2a99
git merge-tree --write-tree 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 955a6dbe12727951437e96e81b4f7a9b165f8661
gh pr checks 15315 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff check passed No whitespace errors.
Conventions and template failed Required template headings are missing.
Export ABI audit passed 151 symbols scanned; no lexical findings.
Test assertions in Release failed assert expands to a no-op under -DNDEBUG.
Current-main merge preview passed Exact head merges cleanly with base.
Cairo stack previews failed Conflicts with #14328 and #14329 in four shared files.
Hosted checks not run All six initial jobs were queued.
Local build and CTest not run No local build was configured.
Precheck table and raw output
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...4563a8c6fbb9de7d88753dfcd3dc958abae31ea4
conventions_and_pr_template failed /usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --title feat(libcairo): implement seventeen context and CTM exports --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15315 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1 --json core/libs/prx/libcairo/CMakeLists.txt core/libs/prx/libcairo/Context.cpp core/libs/prx/libcairo/Export.cpp core/libs/prx/libcairo/Surface.cpp core/libs/prx/libcairo/include/Context.hpp core/libs/prx/libcairo/include/InventoryExports.hpp core/libs/prx/libcairo/include/Surface.hpp core/libs/prx/libcairo/libcairo.hpp core/libs/tests/GuestCairoContext.cpp core/libs/tests/GuestCairoSurface.cpp docs/dev/debt/libcairo.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.
(pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template
(pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template
(pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template
3 findings, 3 errors; GitHub shows at most 10 error annotations, the job summary lists all
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_test_quality.py': [Errno 2] No such file or directory

The isolated PR snapshot does not contain these reviewer-only scripts. The ABI audit was run from the workspace and passed; the test-quality helper was unavailable, so I inspected the test and CMake registration directly.

{
  "status": "passed",
  "symbol_count": 151,
  "finding_count": 0
}
}
(static_cast<void> (0));
#14328 merge-tree exit=1
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp
CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md
#14329 merge-tree exit=1
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp
CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md
conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545783898/job/125620934591
eligibility	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545784043/job/125620932923
intake	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545784034/job/125620934840
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545783910/job/125620934199
library-portability	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545783979/job/125620932459
report	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41545784046/job/125620933422

Negative control

Assertion Change to code under test Did the new test fail?
A broken runtime condition is caught by each new C++ test. No source mutation or executable test run; the tests use assert, which is removed by the Release NDEBUG configuration. Not exercised.

Findings

Blocking

  • Both new C++ test files use <cassert> for runtime checks, but the repository build workflow configures CMAKE_BUILD_TYPE=Release, and the test target helper does not undefine NDEBUG. In that configuration, the assertions compile away; the CTest targets can therefore pass without checking the results they claim to cover. Keep checks active in both test files, for example with an always-on test helper or by undefining NDEBUG before including <cassert>, and make sure the Release CTest path actually exercises them.

  • The PR description replaces the required template with ## Summary, ## Validation and ## Dependencies and scope. The conventions precheck fails because ### What, ### Tested and ### Checklist are absent. Restore the full template, tick every applicable box, and complete the required Depends on, Unblocks, GPUs tested and AI-assisted fields.

  • GuestCairoContext.cpp adds an inline code comment, contrary to the repository rule that code comments are prohibited except namespace ends and #endif.

        cairo_scale(context, 0, 1);
    

Non-blocking

  • The exact head has pairwise merge conflicts with open #14328 and #14329 in CMakeLists.txt, Export.cpp, InventoryExports.hpp and docs/dev/debt/libcairo.md. Those PRs describe the landing order #14327 → #14328 → #14329, while this PR says it is stacked on #14327. Please coordinate and record where this PR fits in the sequence before integration; the conflicts do not prevent this head from merging with current main by itself.

Sources

Not verified

  • No AnyPS5 build or CTest was run locally. The hosted checks were queued at final refresh; no hosted build or test result is claimed.
  • The Windows and Linux runs described in the PR body are author-reported, not runs I performed.
  • No negative control or PS5 console test was run.

To get this to a good state

Restore the PR template, keep test assertions active in Release, remove the inline code comment, and record the coordinated order for #14327, #14328, #14329 and this PR. On the updated head, rerun git diff --check, python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315, the ABI audit, and the pairwise merge previews after the dependency order is agreed; I will inspect the new head and the same results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5745000451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15315#pullrequestreview-5745000451). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T23:41:00Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The new tests lose their runtime assertions in the repository’s Release configuration, and this head also fails the required PR-template and source-comment rules. ## What I ran Reviewed all 11 changed files at head `4563a8c6fbb9de7d88753dfcd3dc958abae31ea4` against PR base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`. The head contains the open #14327 head as an ancestor and merges cleanly with current `main`. Pairwise previews against open #14328 and #14329 report conflicts in shared Cairo integration files. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not configure or build AnyPS5. ```sh git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --json > /tmp/anyps5-pr-precheck/15315-abi.json python3 -c 'import json; d=json.load(open("/tmp/anyps5-pr-precheck/15315-abi.json")); print(json.dumps({"status":d.get("status"),"symbol_count":len(d.get("symbols",[])),"finding_count":len(d.get("findings",[]))},indent=2))' printf '#include <cassert>\nassert(false);\n' | c++ -DNDEBUG -E -P -x c++ - | tail -2 git merge-tree --write-tree 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 4693e20f3e04b5b81d65e98d09ed661ec96a2a99 git merge-tree --write-tree 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 955a6dbe12727951437e96e81b4f7a9b165f8661 gh pr checks 15315 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff check | passed | No whitespace errors. | | Conventions and template | failed | Required template headings are missing. | | Export ABI audit | passed | 151 symbols scanned; no lexical findings. | | Test assertions in Release | failed | `assert` expands to a no-op under `-DNDEBUG`. | | Current-main merge preview | passed | Exact head merges cleanly with base. | | Cairo stack previews | failed | Conflicts with #14328 and #14329 in four shared files. | | Hosted checks | not run | All six initial jobs were queued. | | Local build and CTest | not run | No local build was configured. | <details> <summary>Precheck table and raw output</summary> | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...4563a8c6fbb9de7d88753dfcd3dc958abae31ea4` | | conventions_and_pr_template | failed | `/usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --title feat(libcairo): implement seventeen context and CTM exports --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 4563a8c6fbb9de7d88753dfcd3dc958abae31ea4 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15315 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1 --json core/libs/prx/libcairo/CMakeLists.txt core/libs/prx/libcairo/Context.cpp core/libs/prx/libcairo/Export.cpp core/libs/prx/libcairo/Surface.cpp core/libs/prx/libcairo/include/Context.hpp core/libs/prx/libcairo/include/InventoryExports.hpp core/libs/prx/libcairo/include/Surface.hpp core/libs/prx/libcairo/libcairo.hpp core/libs/tests/GuestCairoContext.cpp core/libs/tests/GuestCairoSurface.cpp docs/dev/debt/libcairo.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ```text (pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template 3 findings, 3 errors; GitHub shows at most 10 error annotations, the job summary lists all ``` ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15315-4563a8c6fbb9/head-4563a8c6fbb9-cdd473f1/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` The isolated PR snapshot does not contain these reviewer-only scripts. The ABI audit was run from the workspace and passed; the test-quality helper was unavailable, so I inspected the test and CMake registration directly. ```json { "status": "passed", "symbol_count": 151, "finding_count": 0 } ``` ```text } (static_cast<void> (0)); ``` ```text #14328 merge-tree exit=1 CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md #14329 merge-tree exit=1 CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md ``` ```text conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545783898/job/125620934591 eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545784043/job/125620932923 intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545784034/job/125620934840 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545783910/job/125620934199 library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545783979/job/125620932459 report pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41545784046/job/125620933422 ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | A broken runtime condition is caught by each new C++ test. | No source mutation or executable test run; the tests use `assert`, which is removed by the Release `NDEBUG` configuration. | Not exercised. | ## Findings ### Blocking - Both new C++ test files use `<cassert>` for runtime checks, but the repository build workflow configures `CMAKE_BUILD_TYPE=Release`, and the test target helper does not undefine `NDEBUG`. In that configuration, the assertions compile away; the CTest targets can therefore pass without checking the results they claim to cover. Keep checks active in both test files, for example with an always-on test helper or by undefining `NDEBUG` before including `<cassert>`, and make sure the Release CTest path actually exercises them. - The PR description replaces the required template with `## Summary`, `## Validation` and `## Dependencies and scope`. The conventions precheck fails because `### What`, `### Tested` and `### Checklist` are absent. Restore the full template, tick every applicable box, and complete the required `Depends on`, `Unblocks`, `GPUs tested` and `AI-assisted` fields. - `GuestCairoContext.cpp` adds an inline code comment, contrary to the repository rule that code comments are prohibited except namespace ends and `#endif`. ```suggestion cairo_scale(context, 0, 1); ``` ### Non-blocking - The exact head has pairwise merge conflicts with open #14328 and #14329 in `CMakeLists.txt`, `Export.cpp`, `InventoryExports.hpp` and `docs/dev/debt/libcairo.md`. Those PRs describe the landing order #14327 → #14328 → #14329, while this PR says it is stacked on #14327. Please coordinate and record where this PR fits in the sequence before integration; the conflicts do not prevent this head from merging with current `main` by itself. ## Sources - [Release build configuration](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/.github/workflows/build.yml#L38-L42) - [Test target helper has no `NDEBUG` override](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CMakeLists.txt#L10-L16) - [New context test uses `assert` in Release](https://github.com/boykopovar/AnyPS5/blob/4563a8c6fbb9de7d88753dfcd3dc958abae31ea4/core/libs/tests/GuestCairoContext.cpp#L1-L5) - [New surface test uses `assert` in Release](https://github.com/boykopovar/AnyPS5/blob/4563a8c6fbb9de7d88753dfcd3dc958abae31ea4/core/libs/tests/GuestCairoSurface.cpp#L1-L11) - [Prohibited inline comment](https://github.com/boykopovar/AnyPS5/blob/4563a8c6fbb9de7d88753dfcd3dc958abae31ea4/core/libs/tests/GuestCairoContext.cpp#L140) - [Required PR template](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/.github/pull_request_template.md#L1-L19) - [Code-comment restriction](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/AGENTS.md#L5) - [Repository PR template and overlap rules](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CONTRIBUTING.md#L59-L72) - [#14328 shared Cairo integration files](https://github.com/boykopovar/AnyPS5/blob/4693e20f3e04b5b81d65e98d09ed661ec96a2a99/core/libs/prx/libcairo/CMakeLists.txt) - [#14329 shared Cairo integration files](https://github.com/boykopovar/AnyPS5/blob/955a6dbe12727951437e96e81b4f7a9b165f8661/core/libs/prx/libcairo/CMakeLists.txt) ## Not verified - No AnyPS5 build or CTest was run locally. The hosted checks were queued at final refresh; no hosted build or test result is claimed. - The Windows and Linux runs described in the PR body are author-reported, not runs I performed. - No negative control or PS5 console test was run. ## To get this to a good state Restore the PR template, keep test assertions active in Release, remove the inline code comment, and record the coordinated order for #14327, #14328, #14329 and this PR. On the updated head, rerun `git diff --check`, `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315`, the ABI audit, and the pairwise merge previews after the dependency order is agreed; I will inspect the new head and the same results.
MarcZX10 commented 2026-11-03 00:01:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T00:01:07Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The new head still has a mismatched Cairo error-surface status, Release-disabled test assertions, and an incomplete required PR template.

What I ran

Rechecked the prior full diff and the four-file update at head 2ffc401e8e8aa51f413709a652ca0433d45d21bd, against base 5cb015caaaaf83f8ee431414ee6a457b5b307d49; the head merges cleanly with the base. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No AnyPS5 build or C++ tests were run.

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...2ffc401e8e8aa51f413709a652ca0433d45d21bd
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315
python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 2ffc401e8e8aa51f413709a652ca0433d45d21bd --json
git merge-tree --write-tree refs/review/15315/20261103-head refs/review/15315/20261103-14328
git merge-tree --write-tree refs/review/15315/20261103-head refs/review/15315/20261103-14329
printf '#include <cassert>\nassert(false);\n' | c++ -DNDEBUG -E -P -x c++ -
gh pr checks 15315 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff check passed No whitespace errors.
Export ABI audit passed 151 symbols; no lexical findings.
Base merge preview passed Clean against the stated base.
PR template check failed Required template headings are absent.
Sibling merge previews failed Conflicts remain with #14328 and #14329.
Hosted checks not run All four current checks were queued.
Build and C++ tests not run No local build or CTest.
Release assertion probe failed assert(false) preprocesses to a no-op with -DNDEBUG.
Check output
(pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template
(pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template
(pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template
3 findings, 3 errors
{
  "status": "passed",
  "symbol_count": 151,
  "finding_count": 0
}
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp
CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md

The same four files conflicted in the preview against each sibling PR. The context came from the exact live sibling heads recorded in their Sources links.

(static_cast<void> (0));
conventions\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547495424/job/125626547503
eligibility\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547498878/job/125626559141
library-portability\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547499272/job/125626553861
report\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547499241/job/125626553925

The precheck’s isolated snapshot lacked the reviewer-only ABI and test-quality scripts; I ran the ABI audit directly in the workspace. The stack check reported a clean preview against current main. The exact-head PR body reports test runs, but I did not reproduce them.

Negative control

No source mutation or exact-head C++ negative control was run because no test binary was built. The separate preprocessor probe confirms that an assert expression becomes a no-op under -DNDEBUG; it does not execute the PR tests.

Findings

Blocking

  1. cairo_get_target returns the wrong status surface for an error context. cairo_create(nullptr) creates a kNullPointer context, but its static target is initialized with CairoSurfaceError(kNoMemory), and cairo_get_target returns that stored target without checking the context status. The added test consequently expects status 1. Cairo’s cairo_create(NULL) returns a NULL_POINTER context, and cairo_get_target returns an error surface carrying the context’s status. Return an error surface matching the context status and assert kNullPointer for this case. The same getter also returns the ordinary target after a valid context later enters an error state.

  2. The new test assertions are disabled by the repository’s Release configuration. The workflow configures CMAKE_BUILD_TYPE=Release, the shared test-target helper adds no -UNDEBUG, and the preprocessor probe shows assert(false) becomes a no-op under -DNDEBUG. Thus the new context test can pass without checking its claims. Keep these assertions active in Release, for example with an always-on test assertion helper, and ensure the CI CTest target uses it.

  3. The PR description omits required template fields. The conventions checker reports missing ### What, ### Tested and ### Checklist; required checklist entries including Depends on, Unblocks, GPUs tested and AI-assisted are also absent. Restore the complete template and fill every item.

Non-blocking

  • Integration order remains unresolved. The exact current head is an ancestor of #14327, but pairwise previews with the live heads of #14328 and #14329 still conflict in CMakeLists.txt, Export.cpp, InventoryExports.hpp and the libcairo debt file. Agree and record where #15315 lands relative to the #14327 → #14328 → #14329 sequence, then refresh the PR base when those changes land.
  • Correction to my prior review: I withdraw the inline-comment finding. This PR updates docs/dev/debt/libcairo.md, and the repository convention allows code comments when a debt file is changed.

Sources

Not verified

No AnyPS5 build, CTest, Windows run, Linux runtime test, PS5 console test or behavioral negative control was performed. The MinGW, sanitizer and native-Cairo differential results in the description are author-reported, not independently reproduced. Hosted checks were queued at final refresh.

To get this to a good state

Make cairo_get_target return an error surface with the matching context status, correct the null-pointer expectation, keep test assertions active in Release, and restore the full PR template. Coordinate the landing order with #14328 and #14329. On the new head, I will rerun the diff check, precheck, ABI audit, stack previews, assertion probe and applicable hosted checks, then inspect the updated changes and tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5745166450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15315#pullrequestreview-5745166450). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T00:01:07Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The new head still has a mismatched Cairo error-surface status, Release-disabled test assertions, and an incomplete required PR template. ## What I ran Rechecked the prior full diff and the four-file update at head `2ffc401e8e8aa51f413709a652ca0433d45d21bd`, against base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`; the head merges cleanly with the base. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No AnyPS5 build or C++ tests were run. ```sh git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...2ffc401e8e8aa51f413709a652ca0433d45d21bd python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315 python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 2ffc401e8e8aa51f413709a652ca0433d45d21bd --json git merge-tree --write-tree refs/review/15315/20261103-head refs/review/15315/20261103-14328 git merge-tree --write-tree refs/review/15315/20261103-head refs/review/15315/20261103-14329 printf '#include <cassert>\nassert(false);\n' | c++ -DNDEBUG -E -P -x c++ - gh pr checks 15315 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff check | passed | No whitespace errors. | | Export ABI audit | passed | 151 symbols; no lexical findings. | | Base merge preview | passed | Clean against the stated base. | | PR template check | failed | Required template headings are absent. | | Sibling merge previews | failed | Conflicts remain with #14328 and #14329. | | Hosted checks | not run | All four current checks were queued. | | Build and C++ tests | not run | No local build or CTest. | | Release assertion probe | failed | `assert(false)` preprocesses to a no-op with `-DNDEBUG`. | <details><summary>Check output</summary> ```text (pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template 3 findings, 3 errors ``` ```json { "status": "passed", "symbol_count": 151, "finding_count": 0 } ``` ```text CONFLICT (content): Merge conflict in core/libs/prx/libcairo/CMakeLists.txt CONFLICT (content): Merge conflict in core/libs/prx/libcairo/Export.cpp CONFLICT (content): Merge conflict in core/libs/prx/libcairo/include/InventoryExports.hpp CONFLICT (content): Merge conflict in docs/dev/debt/libcairo.md ``` The same four files conflicted in the preview against each sibling PR. The context came from the exact live sibling heads recorded in their Sources links. ```text (static_cast<void> (0)); ``` ```text conventions\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547495424/job/125626547503 eligibility\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547498878/job/125626559141 library-portability\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547499272/job/125626553861 report\tpending\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41547499241/job/125626553925 ``` The precheck’s isolated snapshot lacked the reviewer-only ABI and test-quality scripts; I ran the ABI audit directly in the workspace. The stack check reported a clean preview against current `main`. The exact-head PR body reports test runs, but I did not reproduce them. </details> ## Negative control No source mutation or exact-head C++ negative control was run because no test binary was built. The separate preprocessor probe confirms that an `assert` expression becomes a no-op under `-DNDEBUG`; it does not execute the PR tests. ## Findings ### Blocking 1. **`cairo_get_target` returns the wrong status surface for an error context.** `cairo_create(nullptr)` creates a `kNullPointer` context, but its static target is initialized with `CairoSurfaceError(kNoMemory)`, and `cairo_get_target` returns that stored target without checking the context status. The added test consequently expects status `1`. Cairo’s `cairo_create(NULL)` returns a `NULL_POINTER` context, and `cairo_get_target` returns an error surface carrying the context’s status. Return an error surface matching the context status and assert `kNullPointer` for this case. The same getter also returns the ordinary target after a valid context later enters an error state. 2. **The new test assertions are disabled by the repository’s Release configuration.** The workflow configures `CMAKE_BUILD_TYPE=Release`, the shared test-target helper adds no `-UNDEBUG`, and the preprocessor probe shows `assert(false)` becomes a no-op under `-DNDEBUG`. Thus the new context test can pass without checking its claims. Keep these assertions active in Release, for example with an always-on test assertion helper, and ensure the CI CTest target uses it. 3. **The PR description omits required template fields.** The conventions checker reports missing `### What`, `### Tested` and `### Checklist`; required checklist entries including `Depends on`, `Unblocks`, `GPUs tested` and `AI-assisted` are also absent. Restore the complete template and fill every item. ### Non-blocking - **Integration order remains unresolved.** The exact current head is an ancestor of #14327, but pairwise previews with the live heads of #14328 and #14329 still conflict in `CMakeLists.txt`, `Export.cpp`, `InventoryExports.hpp` and the libcairo debt file. Agree and record where #15315 lands relative to the #14327 → #14328 → #14329 sequence, then refresh the PR base when those changes land. - **Correction to my prior review:** I withdraw the inline-comment finding. This PR updates `docs/dev/debt/libcairo.md`, and the repository convention allows code comments when a debt file is changed. ## Sources - [Null-pointer context setup and `cairo_get_target` at this head](https://github.com/boykopovar/AnyPS5/blob/2ffc401e8e8aa51f413709a652ca0433d45d21bd/core/libs/prx/libcairo/Context.cpp#L43-L55) and [the getter implementation](https://github.com/boykopovar/AnyPS5/blob/2ffc401e8e8aa51f413709a652ca0433d45d21bd/core/libs/prx/libcairo/Context.cpp#L137-L139). - [The new null-target assertion at this head](https://github.com/boykopovar/AnyPS5/blob/2ffc401e8e8aa51f413709a652ca0433d45d21bd/core/libs/tests/GuestCairoContext.cpp#L32-L42) and [pinned Cairo behavior for `cairo_create(NULL)`](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/94612bc0323a0af0053ebec769040a7506fc5c22/src/cairo.c#L369-L381), [`cairo_get_target`](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/94612bc0323a0af0053ebec769040a7506fc5c22/src/cairo.c#L4002-L4025). - [Release build configuration at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/.github/workflows/build.yml#L38-L42) and [test target helper at that base](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CMakeLists.txt#L19-L24). - [Required PR template at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/.github/pull_request_template.md) and [template rules](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CONTRIBUTING.md#L55-L76). - [Comment convention at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CONTRIBUTING.md#L49-L53). - [Current #14327 head](https://github.com/boykopovar/AnyPS5/blob/0205d843cc380350ba5fccdeeacbc09f7a689988/core/libs/prx/libcairo/CMakeLists.txt), [current #14328 head](https://github.com/boykopovar/AnyPS5/blob/4693e20f3e04b5b81d65e98d09ed661ec96a2a99/core/libs/prx/libcairo/CMakeLists.txt), and [current #14329 head](https://github.com/boykopovar/AnyPS5/blob/955a6dbe12727951437e96e81b4f7a9b165f8661/core/libs/prx/libcairo/CMakeLists.txt). ## Not verified No AnyPS5 build, CTest, Windows run, Linux runtime test, PS5 console test or behavioral negative control was performed. The MinGW, sanitizer and native-Cairo differential results in the description are author-reported, not independently reproduced. Hosted checks were queued at final refresh. ## To get this to a good state Make `cairo_get_target` return an error surface with the matching context status, correct the null-pointer expectation, keep test assertions active in Release, and restore the full PR template. Coordinate the landing order with #14328 and #14329. On the new head, I will rerun the diff check, precheck, ABI audit, stack previews, assertion probe and applicable hosted checks, then inspect the updated changes and tests.
MarcZX10 commented 2026-11-03 07:54:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T07:54:28Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The current implementation reports incorrect Cairo error statuses from cairo_get_target and returns the image type for rectangle subsurfaces.

What I ran

Reviewed all 11 changed files at head efbf7f24b950791cda5afe2718877acfa4287563 against the PR base 5cb015caaaaf83f8ee431414ee6a457b5b307d49. The current main tip is d1ae628bc2f62459cce1e9872ba5632c938c71f2; the stack checker reports clean individual merge previews against that tip. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. No local build or CTest was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315
git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...efbf7f24b950791cda5afe2718877acfa4287563
python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head efbf7f24b950791cda5afe2718877acfa4287563
python3 tools/pr_stack_check.py 15315 --repo boykopovar/AnyPS5
gh pr checks 15315 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed No whitespace or convention errors.
Export declaration audit passed No lexical mismatches found.
Test registration passed Both new Cairo tests are added to CTest in CMake.
Current-main merge preview passed Individual preview is clean; declared Cairo dependency heads are not included.
Hosted checks passed Applicable Windows and policy checks passed; specialized jobs were skipped.
Local C++ build and tests not run No exact-head binary was available; I did not build.
Precheck quality heuristic not executable Its helper is absent from the isolated PR snapshot.
Check output
All conventions checks passed.

git diff --check exited successfully with no output. The ABI audit printed ABI audit: passed and findings: []. The precheck recorded the optional test-quality helper as unavailable because tools/pr_test_quality.py is absent from the isolated head snapshot. gh pr checks reported windows, conventions, eligibility, labels, library-portability and report as passed; the Linux and specialized jobs were skipped.

Negative control

Not run: the added C++ tests require a build, and no negative-control binary was available.

Findings

Blocking

  1. cairo_get_target returns the wrong surface status after context errors. After cairo_scale(context, 0, 1) the context status is kInvalidMatrix (5), and after an unmatched cairo_restore it is kInvalidRestore (2), but this function returns CairoSurfaceError(kNoMemory) (1). The null-pointer error context also stores a no-memory target despite its context status being kNullPointer (7). Callers therefore observe a different error through cairo_surface_status(cairo_get_target(context)) than through cairo_status(context). Return an error surface carrying the context's actual status, and initialize the null-pointer error target with the null-pointer status; update the tests to assert those statuses.

  2. Rectangle subsurfaces report the image surface type. cairo_surface_create_for_rectangle creates a non-image surface, but cairo_surface_get_type unconditionally returns kImageSurfaceType, and the test currently asserts that value. Cairo assigns rectangle subsurfaces the distinct CAIRO_SURFACE_TYPE_SUBSURFACE type. Store/return the corresponding ABI type for this surface and assert it in the test.

Non-blocking

None found in the reviewed files beyond the two blockers above.

Sources

Not verified

I did not build or run the C++ tests, test other operating systems, or run console behavior. The hosted Linux and specialized jobs were skipped. The lexical ABI audit does not prove calling-convention or runtime ABI compatibility.

To get this to a good state

Correct both error-status and surface-type behaviors, update the assertions to check Cairo's reported values, then I will rerun the precheck and inspect the new exact head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748758956 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15315#pullrequestreview-5748758956). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T07:54:28Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The current implementation reports incorrect Cairo error statuses from `cairo_get_target` and returns the image type for rectangle subsurfaces. ## What I ran Reviewed all 11 changed files at head `efbf7f24b950791cda5afe2718877acfa4287563` against the PR base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`. The current `main` tip is `d1ae628bc2f62459cce1e9872ba5632c938c71f2`; the stack checker reports clean individual merge previews against that tip. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. No local build or CTest was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15315 git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...efbf7f24b950791cda5afe2718877acfa4287563 python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head efbf7f24b950791cda5afe2718877acfa4287563 python3 tools/pr_stack_check.py 15315 --repo boykopovar/AnyPS5 gh pr checks 15315 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention errors. | | Export declaration audit | passed | No lexical mismatches found. | | Test registration | passed | Both new Cairo tests are added to CTest in CMake. | | Current-main merge preview | passed | Individual preview is clean; declared Cairo dependency heads are not included. | | Hosted checks | passed | Applicable Windows and policy checks passed; specialized jobs were skipped. | | Local C++ build and tests | not run | No exact-head binary was available; I did not build. | | Precheck quality heuristic | not executable | Its helper is absent from the isolated PR snapshot. | <details> <summary>Check output</summary> ```text All conventions checks passed. ``` `git diff --check` exited successfully with no output. The ABI audit printed `ABI audit: passed` and `findings: []`. The precheck recorded the optional test-quality helper as unavailable because `tools/pr_test_quality.py` is absent from the isolated head snapshot. `gh pr checks` reported `windows`, `conventions`, `eligibility`, `labels`, `library-portability` and `report` as passed; the Linux and specialized jobs were skipped. </details> ## Negative control Not run: the added C++ tests require a build, and no negative-control binary was available. ## Findings ### Blocking 1. **`cairo_get_target` returns the wrong surface status after context errors.** After `cairo_scale(context, 0, 1)` the context status is `kInvalidMatrix` (5), and after an unmatched `cairo_restore` it is `kInvalidRestore` (2), but this function returns `CairoSurfaceError(kNoMemory)` (1). The null-pointer error context also stores a no-memory target despite its context status being `kNullPointer` (7). Callers therefore observe a different error through `cairo_surface_status(cairo_get_target(context))` than through `cairo_status(context)`. Return an error surface carrying the context's actual status, and initialize the null-pointer error target with the null-pointer status; update the tests to assert those statuses. 2. **Rectangle subsurfaces report the image surface type.** `cairo_surface_create_for_rectangle` creates a non-image surface, but `cairo_surface_get_type` unconditionally returns `kImageSurfaceType`, and the test currently asserts that value. Cairo assigns rectangle subsurfaces the distinct `CAIRO_SURFACE_TYPE_SUBSURFACE` type. Store/return the corresponding ABI type for this surface and assert it in the test. ### Non-blocking None found in the reviewed files beyond the two blockers above. ## Sources - [The reviewed `cairo_get_target` implementation and its error-status test](https://github.com/boykopovar/AnyPS5/blob/efbf7f24b950791cda5afe2718877acfa4287563/core/libs/prx/libcairo/Context.cpp#L138-L143) and [test](https://github.com/boykopovar/AnyPS5/blob/efbf7f24b950791cda5afe2718877acfa4287563/core/libs/tests/GuestCairoContext.cpp#L147-L165). - [Cairo's pinned `cairo_get_target` implementation returns an error surface with `cr->status`](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/94612bc0323a0af0053ebec769040a7506fc5c22/src/cairo.c#L4018-L4024). - [The reviewed surface type implementation and subsurface test](https://github.com/boykopovar/AnyPS5/blob/efbf7f24b950791cda5afe2718877acfa4287563/core/libs/prx/libcairo/Surface.cpp#L234-L235) and [test](https://github.com/boykopovar/AnyPS5/blob/efbf7f24b950791cda5afe2718877acfa4287563/core/libs/tests/GuestCairoSurface.cpp#L186-L191). - [Pinned Cairo surface-type getter](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/9669b300a06eb793bb112737cb9085ff020de682/src/cairo-surface.c#L187-L205), [subsurface backend type and constructor](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/9669b300a06eb793bb112737cb9085ff020de682/src/cairo-surface-subsurface.c#L445-L446), and [type declaration](https://chromium.googlesource.com/chromiumos/third_party/cairo/+/9669b300a06eb793bb112737cb9085ff020de682/src/cairo.h#L2081-L2083). ## Not verified I did not build or run the C++ tests, test other operating systems, or run console behavior. The hosted Linux and specialized jobs were skipped. The lexical ABI audit does not prove calling-convention or runtime ABI compatibility. ## To get this to a good state Correct both error-status and surface-type behaviors, update the assertions to check Cairo's reported values, then I will rerun the precheck and inspect the new exact head.
Sign in to join this conversation.
No reviewers
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!15315
No description provided.