test: fix victory-metal/tests/resources.rs pool sizes for 16KB pages #77

Merged
ShivamCodesBS merged 2 commits from upstream-pr/77 into main 2026-11-26 17:08:16 +00:00
ShivamCodesBS commented 2026-11-26 13:42:49 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by ShivamCodesBS on 2026-11-26T13:42:49Z.


Derive page count from actual buffer sizes instead of fixed pages:

  • srv_and_uav_through_a_descriptor_table: 2 buffers × 16 KiB = 32 KiB → pages = ceil(32 KiB / page_size())
  • texture_over_zero_copy_memory: 4x4 RGBA8Unorm texture → 1 page (smallest)

Also add sentence to existing Rosetta alignment note in docs/native-host.md (~239): two reported 4 KiB pages cannot hold the two 16 KiB buffers; test helpers clamp allocation unit to 16 KiB via page_size().max(16384). Note that the 16 KiB clamp lives in the GPU test helpers, not victory-metal::mem.

This addresses reviewer feedback from PR #48:

  • Reverts victory-gpu pool changes (already handled by main's page_size().max(16384))
  • Fixes victory-metal/tests/resources.rs to derive pages from buffer sizes
  • Adds Rosetta page_size() note to docs/native-host.md in existing alignment note

What this changes

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • Ran the game (say how far it got), or not needed

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md
  • New diagnostics are behind a VICTORY_* variable and documented
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5511122373 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/77). Originally posted by [ShivamCodesBS](https://github.com/ShivamCodesBS) on 2026-11-26T13:42:49Z. --- Derive page count from actual buffer sizes instead of fixed pages: - srv_and_uav_through_a_descriptor_table: 2 buffers × 16 KiB = 32 KiB → pages = ceil(32 KiB / page_size()) - texture_over_zero_copy_memory: 4x4 RGBA8Unorm texture → 1 page (smallest) Also add sentence to existing Rosetta alignment note in docs/native-host.md (~239): two reported 4 KiB pages cannot hold the two 16 KiB buffers; test helpers clamp allocation unit to 16 KiB via page_size().max(16384). Note that the 16 KiB clamp lives in the GPU test helpers, not victory-metal::mem. This addresses reviewer feedback from PR #48: - Reverts victory-gpu pool changes (already handled by main's page_size().max(16384)) - Fixes victory-metal/tests/resources.rs to derive pages from buffer sizes - Adds Rosetta page_size() note to docs/native-host.md in existing alignment note ## What this changes <!-- One change per pull request. Link the issue or ROADMAP item. --> ## How it was tested - [ ] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory` - [ ] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - [ ] Ran the game (say how far it got), or not needed ## Checklist - [ ] No game files, game code, disassembly listings or SDK files are included - [ ] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md - [ ] New diagnostics are behind a `VICTORY_*` variable and documented
LakshanSivakumar commented 2026-11-26 14:55:03 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T14:55:03Z.

Review: CHANGES_REQUESTED


Thanks, this supersedes #48 once trimmed. Please drop the present.rs sampler hunk (out of scope; #91 fixes the black window), revert the unrequested arena change in texture_over_zero_copy_memory, and make the docs sentence agree with the test (the doc says the helpers clamp with page_size().max(16384), the test uses plain page_size()).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6076254534 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/77#pullrequestreview-6076254534). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T14:55:03Z. **Review:** CHANGES_REQUESTED --- Thanks, this supersedes #48 once trimmed. Please drop the present.rs sampler hunk (out of scope; #91 fixes the black window), revert the unrequested arena change in texture_over_zero_copy_memory, and make the docs sentence agree with the test (the doc says the helpers clamp with `page_size().max(16384)`, the test uses plain `page_size()`).
LakshanSivakumar commented 2026-11-26 17:08:41 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T17:08:41Z.


Merged in 8c47ddd, with a small fix commit on top. I dropped the present.rs sampler change, since it's out of scope and the black window is #91. I also restored the two-page arena in texture_over_zero_copy_memory and rewrote the doc sentence to match the test. Thanks!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7198563079 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/77#issuecomment-7198563079). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T17:08:41Z. --- Merged in 8c47ddd, with a small fix commit on top. I dropped the `present.rs` sampler change, since it's out of scope and the black window is #91. I also restored the two-page arena in `texture_over_zero_copy_memory` and rewrote the doc sentence to match the test. Thanks!
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
LakshanSivakumar/Native-Victory-macOS!77
No description provided.