playgo: answer chunks of an unknown chunk table as installed #2538

Open
github-bot wants to merge 1 commit from github-bot/gh-2538 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-11-24 07:09 UTC · original
Nawid3333:fix/playgo-unknown-chunk-table → main · +45 −6 · 2 files · 1 commits · open

Crimson Desert (#2321) has no PlayGo chunk table in its dump: sce_sys/playgo-chunk.dat, playgo-chunkdefs.xml and Data/chunkmanifest are all missing. Since e4cc27d11 such a package counts as one chunk, so every id from 1 up gets PLAYGO_ERROR_BAD_CHUNK_ID. On KytyPS5-2026-11-17-2638b1b the game reads its own packages/meta/0.papgt, asks PlayGoGetLocus for chunk 1, opens a message dialog and returns -1 from main. On KytyPS5-2026-11-16-1e87171, before that commit, PlayGoOpen answers PLAYGO_ERROR_NOT_SUPPORT_PLAYGO without a table (and without --playgo-hack); the game made no chunk query there and ran on until a later shader stop.

Without a table the emulator can't tell which chunk ids exist; Crimson Desert asks for chunk 1 right after reading its own 0.papgt.

Change

  • With a chunk table: unchanged.
  • Without one: PlayGoGetChunkId still lists chunk 0 only (--playgo-hack still lists 1000), but ids below PLAYGO_DEFAULT_CHUNKS_NUM (1000) count as installed (PLAYGO_LOCUS_LOCAL_FAST). Ids from 1000 still get PLAYGO_ERROR_BAD_CHUNK_ID, so a game that walks ids until the first error still stops.

This reverses part of the test that came with e4cc27d11: GetLocus(1) for a package without chunk metadata was PLAYGO_ERROR_BAD_CHUNK_ID and is now PLAYGO_LOCUS_LOCAL_FAST.

Test

  • tests/PlayGoTests.cpp: the no-metadata test now expects 1 listed chunk, GetLocus 0 and 1 = PLAYGO_LOCUS_LOCAL_FAST and 1000 = PLAYGO_ERROR_BAD_CHUNK_ID. With upstream/main src it fails (GetLocus(1) returns 0x80B2000C).
  • New PackageWithChunkMetadataRejectsChunksPastItsTable: a 2-chunk table gives 2 listed chunks, id 1 = PLAYGO_LOCUS_LOCAL_FAST, id 2 = PLAYGO_ERROR_BAD_CHUNK_ID.
  • playgo_tests: 3 of 3 pass with the change.

Fork CI (Windows, Linux, macOS): https://github.com/Nawid3333/KytyPS5/actions/runs/45337601126/attempts/1

Game: with a fork build of this commit (2a03bda) and without --playgo-hack, Crimson Desert gets past PlayGo in a tester's run (#2321): it asks for chunk 1 and goes on to read packages/0000/0.pamt and the other package tables. It then stops at the same compute shader as on 1e87171 (0xfc0aa7b2901ca28e, pc 0x74, resource tracking), a separate issue.

Other dumps without a table also ask for chunk ids from 1 up in tester logs. GTA San Andreas Definitive Edition (PPSA03524 in #2370), Returnal (#2373) and Alan Wake 2 (#947) ask for chunk 1 once on builds with e4cc27d11 and go on. A Plague Tale: Innocence (#1994) asks for 1 and 2, and Avatar: Frontiers of Pandora (#2331) polls 0 to 5. In these logs, Crimson Desert is the only game that ends right after the answer.

Refs #2321

Written with Claude Code (AI): Claude Code wrote the change and the tests and ran the local tests; the game run is a tester's.

🤖 Generated with Claude Code

**@⁠Nawid3333** on GitHub · 2026-11-24 07:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2538) `Nawid3333:fix/playgo-unknown-chunk-table` → `main` · +45 −6 · 2 files · 1 commits · open Crimson Desert (#2321) has no PlayGo chunk table in its dump: `sce_sys/playgo-chunk.dat`, `playgo-chunkdefs.xml` and `Data/chunkmanifest` are all missing. Since e4cc27d11 such a package counts as one chunk, so every id from 1 up gets `PLAYGO_ERROR_BAD_CHUNK_ID`. On `KytyPS5-2026-11-17-2638b1b` the game reads its own `packages/meta/0.papgt`, asks `PlayGoGetLocus` for chunk 1, opens a message dialog and returns -1 from main. On `KytyPS5-2026-11-16-1e87171`, before that commit, `PlayGoOpen` answers `PLAYGO_ERROR_NOT_SUPPORT_PLAYGO` without a table (and without `--playgo-hack`); the game made no chunk query there and ran on until a later shader stop. Without a table the emulator can't tell which chunk ids exist; Crimson Desert asks for chunk 1 right after reading its own `0.papgt`. ## Change - With a chunk table: unchanged. - Without one: `PlayGoGetChunkId` still lists chunk 0 only (`--playgo-hack` still lists 1000), but ids below `PLAYGO_DEFAULT_CHUNKS_NUM` (1000) count as installed (`PLAYGO_LOCUS_LOCAL_FAST`). Ids from 1000 still get `PLAYGO_ERROR_BAD_CHUNK_ID`, so a game that walks ids until the first error still stops. This reverses part of the test that came with e4cc27d11: `GetLocus(1)` for a package without chunk metadata was `PLAYGO_ERROR_BAD_CHUNK_ID` and is now `PLAYGO_LOCUS_LOCAL_FAST`. ## Test - `tests/PlayGoTests.cpp`: the no-metadata test now expects 1 listed chunk, `GetLocus` 0 and 1 = `PLAYGO_LOCUS_LOCAL_FAST` and 1000 = `PLAYGO_ERROR_BAD_CHUNK_ID`. With `upstream/main` src it fails (`GetLocus(1)` returns `0x80B2000C`). - New `PackageWithChunkMetadataRejectsChunksPastItsTable`: a 2-chunk table gives 2 listed chunks, id 1 = `PLAYGO_LOCUS_LOCAL_FAST`, id 2 = `PLAYGO_ERROR_BAD_CHUNK_ID`. - `playgo_tests`: 3 of 3 pass with the change. Fork CI (Windows, Linux, macOS): https://github.com/Nawid3333/KytyPS5/actions/runs/45337601126/attempts/1 Game: with a fork build of this commit (`2a03bda`) and without `--playgo-hack`, Crimson Desert gets past PlayGo in a tester's run (https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2321): it asks for chunk 1 and goes on to read `packages/0000/0.pamt` and the other package tables. It then stops at the same compute shader as on `1e87171` (`0xfc0aa7b2901ca28e`, pc `0x74`, resource tracking), a separate issue. Other dumps without a table also ask for chunk ids from 1 up in tester logs. GTA San Andreas Definitive Edition (PPSA03524 in #2370), Returnal (#2373) and Alan Wake 2 (#947) ask for chunk 1 once on builds with e4cc27d11 and go on. A Plague Tale: Innocence (#1994) asks for 1 and 2, and Avatar: Frontiers of Pandora (#2331) polls 0 to 5. In these logs, Crimson Desert is the only game that ends right after the answer. Refs #2321 Written with Claude Code (AI): Claude Code wrote the change and the tests and ran the local tests; the game run is a tester's. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A dump without playgo-chunk.dat, playgo-chunkdefs.xml or Data/chunkmanifest
does not say how many chunks its package has. Chunk ids up to the PlayGo
default chunk count are answered as installed instead of rejected, while
scePlayGoGetChunkId still lists only chunk 0. A package with a chunk table
still rejects ids past it.

Crimson Desert (PPSA25286, #2321) asks for chunk 1 after reading its
package table and returns from main after BAD_CHUNK_ID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:24 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-24 07:13 UTC · original

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

PlayGo now records whether the system-content lookup returned a chunk count. Chunk validation uses the returned count when known and otherwise uses the default limit of 1000. Tests cover chunk IDs with no package metadata and with metadata that declares two chunks.

Suggested reviewers: nmzik

Change: Bug fix

Merge Risk: Minimal · up to 2a03b

This change lets packages without PlayGo chunk metadata report chunk IDs below 1000 as installed, while packages with a chunk table still reject IDs beyond it. Tests cover both cases, and no merge-blocking risk is apparent.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main behavior change: PlayGo now answers chunk IDs from an unknown chunk table as installed. The raw summary describes a change to is_valid_chunk and the no-metadata default, which…
Description check Passed The description states the problem (Crimson Desert's missing PlayGo chunk table causing PLAYGO_ERROR_BAD_CHUNK_ID for chunk 1), the change (IDs below PLAYGO_DEFAULT_CHUNKS_NUM count as installed when …
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: Title check

Explanation

The title names the main behavior change: PlayGo now answers chunk IDs from an unknown chunk table as installed. The raw summary describes a change to is_valid_chunk and the no-metadata default, which matches this. The title is short and specific, and it does not describe the emulator's wider behavior in detail, which is acceptable.

Full details: Description check

Explanation

The description states the problem (Crimson Desert's missing PlayGo chunk table causing PLAYGO_ERROR_BAD_CHUNK_ID for chunk 1), the change (IDs below PLAYGO_DEFAULT_CHUNKS_NUM count as installed when no table exists, while the table case is unchanged), and the tests updated in tests/PlayGoTests.cpp. This matches the raw summary and objectives.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4e90654506 and 2a03bda58d.

Files selected for processing: 2

  • src/libs/libPlayGo.cpp
  • tests/PlayGoTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-24 07:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2538#issuecomment-7124752056) <!-- coderabbit-ai-generated:v1 --> <!-- 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/2538?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-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> PlayGo now records whether the system-content lookup returned a chunk count. Chunk validation uses the returned count when known and otherwise uses the default limit of 1000. Tests cover chunk IDs with no package metadata and with metadata that declares two chunks. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"2a03bda58d6bfa9077e29dd8df198383f4912341" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>2a03b</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `2a03b` --> <!-- final_review_risk_coverage:{"sourceCommitId":"2a03bda58d6bfa9077e29dd8df198383f4912341","coveredCommitId":"2a03bda58d6bfa9077e29dd8df198383f4912341","kind":"reviewed"} --> This change lets packages without PlayGo chunk metadata report chunk IDs below 1000 as installed, while packages with a chunk table still reject IDs beyond it. Tests cover both cases, and no merge-blocking risk is apparent. <!-- 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</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main behavior change: PlayGo now answers chunk IDs from an unknown chunk table as installed. The raw summary describes a change to is_valid_chunk and the no-metadata default, which… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description states the problem (Crimson Desert's missing PlayGo chunk table causing PLAYGO_ERROR_BAD_CHUNK_ID for chunk 1), the change (IDs below PLAYGO_DEFAULT_CHUNKS_NUM count as installed when … | | 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. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main behavior change: PlayGo now answers chunk IDs from an unknown chunk table as installed. The raw summary describes a change to is_valid_chunk and the no-metadata default, which matches this. The title is short and specific, and it does not describe the emulator's wider behavior in detail, which is acceptable. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description states the problem (Crimson Desert's missing PlayGo chunk table causing PLAYGO_ERROR_BAD_CHUNK_ID for chunk 1), the change (IDs below PLAYGO_DEFAULT_CHUNKS_NUM count as installed when no table exists, while the table case is unchanged), and the tests updated in tests/PlayGoTests.cpp. This matches the raw summary and objectives. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2538)! 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> <br> - [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> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/4e90654506c8078649e2c1d22c763164406497da/.coderabbit.yaml>) - **Commit**: [4e90654](<https://github.com/KytyPS5/KytyPS5/commit/4e90654506c8078649e2c1d22c763164406497da>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `5245b0f4-8cff-47c0-a87f-5bd987110986` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 4e90654506c8078649e2c1d22c763164406497da and 2a03bda58d6bfa9077e29dd8df198383f4912341. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 2</strong></summary> <dl> <dd> <br> * `src/libs/libPlayGo.cpp` * `tests/PlayGoTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-24 07:23 UTC · original

@⁠Crispy81 This PR is the change in build 2a03bda: with it, Crimson Desert got past PlayGo for you without --playgo-hack (#2321). Could you confirm that here? No new run needed.

**@⁠Nawid3333** on GitHub · 2026-11-24 07:23 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2538#issuecomment-7124946934) @⁠Crispy81 This PR is the change in build `2a03bda`: with it, Crimson Desert got past PlayGo for you without `--playgo-hack` (#2321). Could you confirm that here? No new run needed.
Author
Owner

@⁠Crispy81 on GitHub · 2026-11-24 07:29 UTC · original

Believe so

**@⁠Crispy81** on GitHub · 2026-11-24 07:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2538#issuecomment-7125047530) Believe so
This pull request has changes conflicting with the target branch.
  • src/libs/libPlayGo.cpp
  • tests/PlayGoTests.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2538/head:github-bot/gh-2538'
git switch 'github-bot/gh-2538'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2538'
git switch 'github-bot/gh-2538'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2538'
git switch 'github-bot/gh-2538'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2538'
git switch 'main'
git merge --squash 'github-bot/gh-2538'
git switch 'main'
git merge --ff-only 'github-bot/gh-2538'
git switch 'main'
git merge 'github-bot/gh-2538'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.