agc: Cleanup names so they match NIDs #1508

Manually merged
github merged 2 commits from gh-pr/1508/head into gh-pr/1508/base 2026-11-26 09:58:21 +00:00
Owner

@⁠opcod3 on GitHub · 2026-10-14 14:24 UTC · original
opcod3:agc-cleanup → main · +21 −21 · 4 files · 2 commits · merged 2026-10-16 00:16 UTC

Simple commit tidying up libSceAgc function names so they match their NIDs. This just a tidy-up commit that makes it more obvious what each function is.

Names were obtained or extrapolated from: https://github.com/flatz/ida_ps5_elf_plugin

**@⁠opcod3** on GitHub · 2026-10-14 14:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508) `opcod3:agc-cleanup` → `main` · +21 −21 · 4 files · 2 commits · merged 2026-10-16 00:16 UTC Simple commit tidying up libSceAgc function names so they match their NIDs. This just a tidy-up commit that makes it more obvious what each function is. Names were obtained or extrapolated from: https://github.com/flatz/ida_ps5_elf_plugin
Simple commit tidying up libSceAgc function names so they match their
NIDs. This just a tidy-up commit that makes it more obvious what each
function is.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:58:19 +00:00
github manually merged commit 979b2a1354 into gh-pr/1508/base 2026-11-26 09:58:21 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 14:37 UTC · original · edited 2026-10-14 14:47 UTC

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 420ed3aa-d367-471a-98ef-d609f8ac8a9c
📥 Commits

Reviewing files that changed from the base of the PR and between 46a3aaa5f10e638dc82cb084ba4dad5e989db189 and 3c57725b9c.

📒 Files selected for processing: 1
  • tests/ShaderRecompilerComputeTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The AGC header and implementation replace opaque export names with descriptive names for shader sizing and fusion, jump-target patching, index-size setting, and default-owner registration. The fusion APIs retain distinct shared-VGPR recomputation behavior. Driver symbol registrations now reference the named implementations. Comments identify several existing registrations as sceAgcAsync and sceAgcDriverAgr symbols.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Refactor

Merge Risk: ⚪ Minimal · up to 3c577

This change renames AGC exports while preserving the existing driver bindings and shader-fusion behavior; no actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: updating AGC function names to match NIDs.
Description check Passed The description directly explains the function-name cleanup and its purpose, and it matches the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (1 skipped: 1 too large.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 14:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508#issuecomment-6170893945) · edited 2026-10-14 14:47 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1508?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary><strong>ℹ️ Recent review info</strong></summary> <dl> <dd> <details> <summary><strong>⚙️ Run configuration</strong></summary> <dl> <dd> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `420ed3aa-d367-471a-98ef-d609f8ac8a9c` </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between 46a3aaa5f10e638dc82cb084ba4dad5e989db189 and 3c57725b9cf203f7286bd0f6d33535f2d4c16b87. </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing: 1</strong></summary> <dl> <dd> * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The AGC header and implementation replace opaque export names with descriptive names for shader sizing and fusion, jump-target patching, index-size setting, and default-owner registration. The fusion APIs retain distinct shared-VGPR recomputation behavior. Driver symbol registrations now reference the named implementations. Comments identify several existing registrations as `sceAgcAsync` and `sceAgcDriverAgr` symbols. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"3c57725b9cf203f7286bd0f6d33535f2d4c16b87" --> **Change:** Refactor <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>3c577</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `3c577` --> <!-- final_review_risk_coverage:{"sourceCommitId":"3c57725b9cf203f7286bd0f6d33535f2d4c16b87","coveredCommitId":"3c57725b9cf203f7286bd0f6d33535f2d4c16b87","kind":"reviewed"} --> This change renames AGC exports while preserving the existing driver bindings and shader-fusion behavior; no actionable merge-blocking risk remains. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-inconclusive-14-v2.svg" width="14" height="14" align="middle" alt="Inconclusive" title="Inconclusive"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 inconclusive</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (1 skipped: 1… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly and concisely describes the main change: updating AGC function names to match NIDs. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the function-name cleanup and its purpose, and it matches the changeset. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (1 skipped: 1 too large.) </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1508)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 14:37 UTC · original
On src/libs/agc.h line 47 (outdated):

@@ -40,11 +40,11 @@ int KYTY_SYSV_ABI   AgcInit(uint32_t* state, uint32_t ver);
 void* KYTY_SYSV_ABI AgcGetRegisterDefaults2(uint32_t ver);
 void* KYTY_SYSV_ABI AgcGetRegisterDefaults2Internal(uint32_t ver);
 int KYTY_SYSV_ABI   AgcCreateShader(Shader** dst, void* header, const volatile void* code);
-int KYTY_SYSV_ABI   AgcUnknownGetFusedShaderSize(SizeAlign* dst, const Shader* front,
+int KYTY_SYSV_ABI   AgcGetFusedShaderSize(SizeAlign* dst, const Shader* front,
                                                  const Shader* back);
-int KYTY_SYSV_ABI   AgcUnknownFuseShaderHalves(Shader* fused_result, const Shader* front,
+int KYTY_SYSV_ABI   AgcFuseShaderHalves_0200(Shader* fused_result, const Shader* front,
                                                const Shader* back, void* scratch_mem);
-int KYTY_SYSV_ABI   AgcUnknownNApJjpKNBl4(Shader* fused_result, const Shader* front,
+int KYTY_SYSV_ABI   AgcFuseShaderHalves(Shader* fused_result, const Shader* front,

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '43,50p' src/libs/agc.h
sed -n '43680,43690p' tests/ShaderRecompilerComputeTests.cpp
sed -n '105,122p' .github/workflows/build.yml
sed -n '195,212p' .github/workflows/build.yml
sed -n '380,397p' .github/workflows/build.yml

Repository: KytyPS5/KytyPS5

Length of output: 3893


🏁 Script executed:

git diff --unified=8 9e41d8320a2774b303fbad344c2347e8d0292e83 46a3aaa5f10e638dc82cb084ba4dad5e989db189 -- src/libs/agc.h tests/ShaderRecompilerComputeTests.cpp
printf '\n--- CMake target definitions and aggregate ---\n'
sed -n '360,378p;568,584p;648,724p' CMakeLists.txt
printf '\n--- CI target commands ---\n'
sed -n '108,121p;197,211p;382,397p' .github/workflows/build.yml

Repository: KytyPS5/KytyPS5

Length of output: 12911


Update the fusion test to use the renamed declarations.

src/libs/agc.h renames both fusion functions, but the test still selects the removed identifiers. The Windows and macOS CI builds explicitly build this test target, so those builds fail.

Suggested fix
-        const auto fuse = older ? Gen5::AgcUnknownNApJjpKNBl4 : Gen5::AgcUnknownFuseShaderHalves;
+        const auto fuse = older ? Gen5::AgcFuseShaderHalves : Gen5::AgcFuseShaderHalves_0200;

The target is excluded from the default build and is not requested by Linux CI. This is a localized CI test-build failure, not a production runtime failure.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 14:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508#discussion_r4272203602) On `src/libs/agc.h` line 47 (outdated): ```diff @@ -40,11 +40,11 @@ int KYTY_SYSV_ABI AgcInit(uint32_t* state, uint32_t ver); void* KYTY_SYSV_ABI AgcGetRegisterDefaults2(uint32_t ver); void* KYTY_SYSV_ABI AgcGetRegisterDefaults2Internal(uint32_t ver); int KYTY_SYSV_ABI AgcCreateShader(Shader** dst, void* header, const volatile void* code); -int KYTY_SYSV_ABI AgcUnknownGetFusedShaderSize(SizeAlign* dst, const Shader* front, +int KYTY_SYSV_ABI AgcGetFusedShaderSize(SizeAlign* dst, const Shader* front, const Shader* back); -int KYTY_SYSV_ABI AgcUnknownFuseShaderHalves(Shader* fused_result, const Shader* front, +int KYTY_SYSV_ABI AgcFuseShaderHalves_0200(Shader* fused_result, const Shader* front, const Shader* back, void* scratch_mem); -int KYTY_SYSV_ABI AgcUnknownNApJjpKNBl4(Shader* fused_result, const Shader* front, +int KYTY_SYSV_ABI AgcFuseShaderHalves(Shader* fused_result, const Shader* front, ``` **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '43,50p' src/libs/agc.h sed -n '43680,43690p' tests/ShaderRecompilerComputeTests.cpp sed -n '105,122p' .github/workflows/build.yml sed -n '195,212p' .github/workflows/build.yml sed -n '380,397p' .github/workflows/build.yml ``` Repository: KytyPS5/KytyPS5 Length of output: 3893 --- 🏁 Script executed: ```bash git diff --unified=8 9e41d8320a2774b303fbad344c2347e8d0292e83 46a3aaa5f10e638dc82cb084ba4dad5e989db189 -- src/libs/agc.h tests/ShaderRecompilerComputeTests.cpp printf '\n--- CMake target definitions and aggregate ---\n' sed -n '360,378p;568,584p;648,724p' CMakeLists.txt printf '\n--- CI target commands ---\n' sed -n '108,121p;197,211p;382,397p' .github/workflows/build.yml ``` Repository: KytyPS5/KytyPS5 Length of output: 12911 --- </details> **Update the fusion test to use the renamed declarations.** `src/libs/agc.h` renames both fusion functions, but the test still selects the removed identifiers. The Windows and macOS CI builds explicitly build this test target, so those builds fail. <details> <summary>Suggested fix</summary> ```diff - const auto fuse = older ? Gen5::AgcUnknownNApJjpKNBl4 : Gen5::AgcUnknownFuseShaderHalves; + const auto fuse = older ? Gen5::AgcFuseShaderHalves : Gen5::AgcFuseShaderHalves_0200; ``` </details> The target is excluded from the default build and is not requested by Linux CI. This is a localized CI test-build failure, not a production runtime failure. <!-- fingerprinting:phantom:medusa:serval --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:f44c72784ea1b3b3cd979d30 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 14:37 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e801f95a-f7c5-4628-9a01-21a29a7fe7c5
📥 Commits

Reviewing files that changed from the base of the PR and between 9e41d8320a and 46a3aaa5f10e638dc82cb084ba4dad5e989db189.

📒 Files selected for processing: 3
  • src/libs/agc.cpp
  • src/libs/agc.h
  • src/libs/libAgcDriver.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 14:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508#pullrequestreview-5519673898) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `e801f95a-f7c5-4628-9a01-21a29a7fe7c5` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9e41d8320a2774b303fbad344c2347e8d0292e83 and 46a3aaa5f10e638dc82cb084ba4dad5e989db189. </details> <details> <summary>📒 Files selected for processing: 3</summary> * `src/libs/agc.cpp` * `src/libs/agc.h` * `src/libs/libAgcDriver.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=1ef8e7d5-b4b5-4ab1-9642-3309c620d8a9 attempt=8ea08192-4cb0-457e-b9af-1a4bd4cde184 batch=1/1 -->
Author
Owner

@⁠opcod3 on GitHub · 2026-10-17 11:12 UTC · original

Hey thanks for merging my pr, could I ask why did you rename AgcGetFusedShaderSize back to AgcUnknownGetFusedShaderSize? The whole idea was to keep the function names aligned with their NIDs

**@⁠opcod3** on GitHub · 2026-10-17 11:12 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508#issuecomment-6233216465) Hey thanks for merging my pr, could I ask why did you rename AgcGetFusedShaderSize back to AgcUnknownGetFusedShaderSize? The whole idea was to keep the function names aligned with their NIDs
Author
Owner

@⁠Nmzik on GitHub · 2026-10-18 15:26 UTC · original

@⁠opcod3 fixed thanks!

**@⁠Nmzik** on GitHub · 2026-10-18 15:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1508#issuecomment-6251669928) @⁠opcod3 fixed thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.