Load BCPack format tables from a local file #366

Merged
TaynanGT merged 1 commit from upstream-pr/366 into main 2026-11-27 20:02:52 +00:00
TaynanGT commented 2026-11-27 19:57:28 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T19:57:28Z.


I removed the bundled BCPack format tables. For titles that use BCPack, point VICTORY_BCPACK_TABLES at a local copy you are authorised to use. The decoder tests use generated tables by default, and the repository policy rejects binary files.

The 13 BCPack tests, the DirectStorage BCPack test and the repository asset-policy test passed. I also checked that the runtime builds without the tables.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5532369174 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/366). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T19:57:28Z. --- I removed the bundled BCPack format tables. For titles that use BCPack, point `VICTORY_BCPACK_TABLES` at a local copy you are authorised to use. The decoder tests use generated tables by default, and the repository policy rejects binary files. The 13 BCPack tests, the DirectStorage BCPack test and the repository asset-policy test passed. I also checked that the runtime builds without the tables.
chatgpt-codex-connector[bot] commented 2026-11-27 19:57:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T19:57:39Z.


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-27T19:59:32.221020Z 916321e PR opened
🔒 Security Review ✅ Completed 2026-11-27T20:00:28.303344Z 916321e PR opened
ℹ️ 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:TaynanGT/Vice-Tay:comment:7227037933 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/366#issuecomment-7227037933). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T19:57:39Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"916321e42b6e838fa5a1c62da008f1ea442508ff","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":"916321e42b6e838fa5a1c62da008f1ea442508ff","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"916321e42b6e838fa5a1c62da008f1ea442508ff","mergeGateEnabled":false,"pullRequestNumber":366,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <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-27T19:59:32.221020Z">2026-11-27T19:59:32.221020Z</relative-time> | `916321e` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-27T20:00:28.303344Z">2026-11-27T20:00:28.303344Z</relative-time> | `916321e` | PR opened | <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>
chatgpt-codex-connector[bot] commented 2026-11-27 19:59:30 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T19:59:30Z.

Code review location: crates/victory-hle/src/modules/dstorage.rs; line 1519

@@ -1512,10 +1512,11 @@ fn bcpack_tables() -> Result<&'static Tables, HRESULT> {
     }
 }
 
-/// The tables VIctory ships with.
 #[cfg(not(test))]
 fn load_bcpack_tables() -> Result<Tables, String> {
-    Tables::builtin().map_err(|e| format!("the built-in BCPack tables: {e}"))
+    let path = std::env::var_os("VICTORY_BCPACK_TABLES")
+        .ok_or("set VICTORY_BCPACK_TABLES to the path of your local BCPack format tables")?;
+    read_bcpack_tables(std::path::Path::new(&path))

P1 Badge Preserve the BCPack tables variable in the launcher

When a user sets VICTORY_BCPACK_TABLES and launches through the documented scripts/play.ps1 or Play-VIctory.cmd flow, scripts/play.ps1:263–265 removes the variable because it is absent from the preserved $paths list. This loader then reports missing tables and every BCPack request fails, even though the user supplied a valid file as instructed. Add VICTORY_BCPACK_TABLES to the launcher's preserved path variables so the standard launch flow can use the newly required external tables.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4723230138 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/366#discussion_r4723230138). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T19:59:30Z. **Code review location:** `crates/victory-hle/src/modules/dstorage.rs`; line 1519 ~~~~diff @@ -1512,10 +1512,11 @@ fn bcpack_tables() -> Result<&'static Tables, HRESULT> { } } -/// The tables VIctory ships with. #[cfg(not(test))] fn load_bcpack_tables() -> Result<Tables, String> { - Tables::builtin().map_err(|e| format!("the built-in BCPack tables: {e}")) + let path = std::env::var_os("VICTORY_BCPACK_TABLES") + .ok_or("set VICTORY_BCPACK_TABLES to the path of your local BCPack format tables")?; + read_bcpack_tables(std::path::Path::new(&path)) ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Preserve the BCPack tables variable in the launcher** When a user sets `VICTORY_BCPACK_TABLES` and launches through the documented `scripts/play.ps1` or `Play-VIctory.cmd` flow, `scripts/play.ps1:263–265` removes the variable because it is absent from the preserved `$paths` list. This loader then reports missing tables and every BCPack request fails, even though the user supplied a valid file as instructed. Add `VICTORY_BCPACK_TABLES` to the launcher's preserved path variables so the standard launch flow can use the newly required external tables. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-11-27 19:59:30 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T19:59:30Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 916321e42b

ℹ️ 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:TaynanGT/Vice-Tay:review:6092857221 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/366#pullrequestreview-6092857221). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T19:59:30Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `916321e42b` <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>
TaynanGT commented 2026-11-29 19:06:59 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:06:59Z.

Code review location: crates/victory-hle/src/modules/dstorage.rs; line 1519

@@ -1512,10 +1512,11 @@ fn bcpack_tables() -> Result<&'static Tables, HRESULT> {
     }
 }
 
-/// The tables VIctory ships with.
 #[cfg(not(test))]
 fn load_bcpack_tables() -> Result<Tables, String> {
-    Tables::builtin().map_err(|e| format!("the built-in BCPack tables: {e}"))
+    let path = std::env::var_os("VICTORY_BCPACK_TABLES")
+        .ok_or("set VICTORY_BCPACK_TABLES to the path of your local BCPack format tables")?;
+    read_bcpack_tables(std::path::Path::new(&path))

This is addressed in the current local launcher: VICTORY_BCPACK_TABLES is explicitly in the preserved paths list, and the launcher warns for an unset or invalid file path. Runtime content validation remains separate.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4732745106 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/366#discussion_r4732745106). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:06:59Z. **Code review location:** `crates/victory-hle/src/modules/dstorage.rs`; line 1519 ~~~~diff @@ -1512,10 +1512,11 @@ fn bcpack_tables() -> Result<&'static Tables, HRESULT> { } } -/// The tables VIctory ships with. #[cfg(not(test))] fn load_bcpack_tables() -> Result<Tables, String> { - Tables::builtin().map_err(|e| format!("the built-in BCPack tables: {e}")) + let path = std::env::var_os("VICTORY_BCPACK_TABLES") + .ok_or("set VICTORY_BCPACK_TABLES to the path of your local BCPack format tables")?; + read_bcpack_tables(std::path::Path::new(&path)) ~~~~ --- This is addressed in the current local launcher: VICTORY_BCPACK_TABLES is explicitly in the preserved paths list, and the launcher warns for an unset or invalid file path. Runtime content validation remains separate.
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
TaynanGT/Vice-Tay!366
No description provided.