tooling: inventory bounded AWC sound-effect metadata #300

Merged
Vonsek merged 3 commits from upstream-pr/305 into main 2026-11-22 02:36:13 +00:00
Vonsek commented 2026-11-21 21:38:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T21:38:01Z.


Change

The resource report identifies the outer package archive by its signature. This adds a bounded audio metadata reader for a caller-supplied ADAT bank range. It reports the number of sounds and groups their recorded sample counts by sample rate and numeric codec ID. The reader validates tag ownership and extents before accessing each 32-byte sound format header.

The supported profile is little-endian v1, flag word 0xff000001 or 0xff020001, with a nonempty data tag and a 0x76 format tag per sound. These field definitions are available in the pinned vgmstream reader. This implementation uses the repository's existing raw range reader and adds no dependency. The experiment gives the CLI and profile limits.

Verification

Commit 77b2bbe1e373cc46aaf82bf50b66a81f11691240 on b53bfb0b6489398aba7a81f3761e2d56aaa00ccf, Windows x64 with Python 3.12.

  • python -B tests/awc_metadata_check.py MetadataChecks.test_command failed before the implementation because the inventory command was absent (exit 2). The same command passes on this commit.
  • In a fresh worktree, python -m venv out/pe-env, out/pe-env/Scripts/python.exe -m pip install -r requirements-dev.txt, . ./tools/dev.ps1, and cmake --preset dev succeeded. ctest --preset dev --no-tests=error -R '^(audio_awc_metadata|resource_range_controls|docs_links)$' --output-on-failure passed all three tests.
  • git diff --check HEAD^ HEAD passed.

Evidence and follow-up

The original MIT-licensed fixture packs three synthetic sounds with two codecs, two sample rates and physically interleaved tags. The command groups their counts and sample totals. A guarded stream returns at most three bytes per read and raises on any request outside the header tables and format metadata. The controls cover a format tag aliasing audio data, a tag extending beyond the supplied range, damaged stream ownership, unsupported flags, and the stream-count budget.

A private inspection of one package used thirty evenly spaced 2 MiB windows to locate aligned ADAT markers. Three hits fit the documented profile. The reader reported 563, 603 and 176 streams, all with 48,000 Hz and numeric codec ID 11. For this observation the supplied extents ended at the greatest declared tag end. Archive directory membership, a codec name and playback remain unverified. No local assets are included.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

This contribution was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6534705237 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/305). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T21:38:01Z. --- ## Change The resource report identifies the outer package archive by its signature. This adds a bounded audio metadata reader for a caller-supplied ADAT bank range. It reports the number of sounds and groups their recorded sample counts by sample rate and numeric codec ID. The reader validates tag ownership and extents before accessing each 32-byte sound format header. The supported profile is little-endian v1, flag word `0xff000001` or `0xff020001`, with a nonempty data tag and a 0x76 format tag per sound. These field definitions are available in the [pinned vgmstream reader](https://github.com/vgmstream/vgmstream/blob/24ffd6ce3e1f34fdebf9f5316d18ad2e162838ce/src/meta/awc.c). This implementation uses the repository's existing raw range reader and adds no dependency. The [experiment](https://github.com/Vonsek/Xbox2Windows/blob/77b2bbe1e373cc46aaf82bf50b66a81f11691240/docs/experiments.md#awc-sound-effect-format-metadata) gives the CLI and profile limits. ## Verification Commit `77b2bbe1e373cc46aaf82bf50b66a81f11691240` on `b53bfb0b6489398aba7a81f3761e2d56aaa00ccf`, Windows x64 with Python 3.12. - `python -B tests/awc_metadata_check.py MetadataChecks.test_command` failed before the implementation because the inventory command was absent (exit 2). The same command passes on this commit. - In a fresh worktree, `python -m venv out/pe-env`, `out/pe-env/Scripts/python.exe -m pip install -r requirements-dev.txt`, `. ./tools/dev.ps1`, and `cmake --preset dev` succeeded. `ctest --preset dev --no-tests=error -R '^(audio_awc_metadata|resource_range_controls|docs_links)$' --output-on-failure` passed all three tests. - `git diff --check HEAD^ HEAD` passed. ## Evidence and follow-up The original MIT-licensed fixture packs three synthetic sounds with two codecs, two sample rates and physically interleaved tags. The command groups their counts and sample totals. A guarded stream returns at most three bytes per read and raises on any request outside the header tables and format metadata. The controls cover a format tag aliasing audio data, a tag extending beyond the supplied range, damaged stream ownership, unsupported flags, and the stream-count budget. A private inspection of one package used thirty evenly spaced 2 MiB windows to locate aligned ADAT markers. Three hits fit the documented profile. The reader reported 563, 603 and 176 streams, all with 48,000 Hz and numeric codec ID 11. For this observation the supplied extents ended at the greatest declared tag end. Archive directory membership, a codec name and playback remain unverified. No local assets are included. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. This contribution was AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:42:20 +00:00
R0Y00 commented 2026-11-24 06:48:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T21:58:39Z.


At 77b2bbe the merge conflicts are in README.md. Keep the AWC capability row alongside the descriptor-key lookup added in #298.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069851913 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/305#issuecomment-7069851913). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T21:58:39Z. --- At `77b2bbe` the merge conflicts are in `README.md`. Keep the AWC capability row alongside the descriptor-key lookup added in #298.
Vonsek commented 2026-11-24 06:48:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T22:04:35Z.


The README at 6543f1e keeps the AWC capability row and the texture descriptor-key lookup from #298. I also retained the AWC and SGD5 checks in CTest and Linux CI when #315 landed. All five selected CTest cases passed locally, and all three CI jobs passed on this commit.

@codex review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069922140 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/305#issuecomment-7069922140). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T22:04:35Z. --- The README at `6543f1e` keeps the AWC capability row and the texture descriptor-key lookup from #298. I also retained the AWC and SGD5 checks in CTest and Linux CI when #315 landed. All five selected CTest cases passed locally, and all three [CI jobs](https://github.com/R0Y00/Xbox2Windows/actions/runs/44954558252) passed on this commit. @codex review
chatgpt-codex-connector[bot commented 2026-11-24 06:48:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T22:07:44Z.


Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 6543f1e500

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069959038 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/305#issuecomment-7069959038). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T22:07:44Z. --- <!-- codex-review-receipt:v1 --> Codex Review: Didn't find any major issues. Another round soon, please! **Reviewed commit:** `6543f1e500` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot commented 2026-11-24 06:48:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T21:38:10Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T22:07:46.487398Z 6543f1e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069612489 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/305#issuecomment-7069612489). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T21:38:10Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6543f1e50042ff75df02d2898eb2bfa582f0b45b","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T22:07:46.487398Z">2026-11-21T22:07:46.487398Z</relative-time> | `6543f1e` | Manual request | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
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
R0Y00/Xbox2Windows!300
No description provided.