GPU/BVH: truncated preparation keys alias distinct guest addresses every 8 GiB #202

Open
opened 2026-11-26 11:30:48 +00:00 by github-bot · 0 comments
Owner

@⁠FunWithFlagsDev on GitHub · 2026-11-26 11:26 UTC · original

<html>

Summary

While reviewing the memory preparation path in the AvatarManz fork, I identified two per-recording deduplication keys that discard significant bits of guest addresses.

Distinct guest addresses separated by multiples of 8 GiB produce identical keys. Consequently, preparing one address may suppress necessary preparation or copy-back registration for another address within the same command list.

The arithmetic collision is reproducible without title files, GPU execution or proprietary data.

A narrowly scoped candidate correction and regression tests are included in the attached archive.

1. Affected revision

Repository: avatarmanz/VIctory-7900XTX

Commit:

0dec5dcc228b6e0b7540d170c2dcd7d52e6d0b99

Affected files:

  • crates/victory-gpu/src/memory.rs

  • crates/victory-gpu/src/host.rs

2. Source-level evidence

In memory.rs:989–1006, the builder's write preparation is deduplicated using:

list.first_use(
    usize::MAX - (4 << 33)
    - (at >> 2 & 0x7FFF_FFFF) as usize
)

The corresponding small-buffer copy-back registration uses:

list.first_use(
    usize::MAX - (5 << 33)
    - (start >> 2 & 0x7FFF_FFFF) as usize
)

Both expressions retain only 31 bits of the shifted address.

The resulting collision period in byte addresses is:

2^(31 + 2) = 2^33 bytes = 8 GiB

This is not a hash collision resolved by the collection's equality check. The original addresses are converted into identical integer keys before insertion.

HostList::first_use inserts these keys into the same per-recording set:

pub(crate) fn first_use(&self, key: usize) -> bool {
    self.deferred().textures.insert(key)
}

The second insertion returns false even when the original guest addresses are distinct.

3. Minimal arithmetic counterexample

Consider four synthetic guest addresses:

Guest address | Location | Masked address -- | -- | -- 0x1_0001_0000 | 4 GiB + 64 KiB | 0x40004000 0x3_0001_0000 | 12 GiB + 64 KiB | 0x40004000 0x5_0001_0000 | 20 GiB + 64 KiB | 0x40004000 0x7_0001_0000 | 28 GiB + 64 KiB | 0x40004000

All 13 Python unit tests passed.

The tests cover:

  • The 8 GiB collision period.

  • Distinct high address bits.

  • Repeated-address deduplication.

  • Separation of operation kinds.

  • Recording reset.

  • Reversed insertion order.

  • Address identity across the representable 40-bit domain.

  • Conditional page-coverage arithmetic.

  • Source transformation and patch-staging safeguards.

The test inputs were deliberately constructed to exercise collisions. These results do not estimate their frequency in the title.

7. Proposed Rust regression

The archive includes a candidate test-only addition alongside the Deferred implementation in host.rs.

Test name:

builder_memory_keys_keep_full_addresses_and_operation_kind

The test checks the original arithmetic collision as a negative control, then verifies that the proposed per-recording set:

  1. Admits distinct addresses separated by 8 GiB.

  2. Deduplicates exact repetitions.

  3. Distinguishes Write from Back.

  4. Keeps independent recordings separate.

  5. Admits the same addresses again after reset.

The proposed test does not require a GPU adapter or title assets.

The Rust implementation and regression have not yet been compiled or executed.

8. Reproduction and candidate integration

Python validation:

python model.py
python -m unittest -v test_model

The included prepare_patch.py script checks the exact upstream revision and normalized Git blob hashes before staging modifications to both affected source files.

On a dedicated checkout of the pinned revision:

python prepare_patch.py /path/to/checkout /path/to/staged

The script generates:

builder-memory-keys.patch
crates/victory-gpu/src/memory.rs
crates/victory-gpu/src/host.rs

Review the generated changes before applying them.

git apply --check /path/to/staged/builder-memory-keys.patch

Suggested native validation:

cargo test -p victory-gpu builder_memory_keys_keep_full_addresses_and_operation_kind -- --nocapture

cargo clippy -p victory-gpu --all-targets -- -D warnings

cargo xtask policy

The staging helper was tested on synthetic source-anchor fixtures. Full-checkout staging and native compilation remain pending.

9. Suggested end-to-end validation

An independent native test could allocate or register two eligible synthetic memory regions separated by 8 GiB.

Using the production memory::ready path within one recording:

  • Request builder write preparation for both addresses.

  • Inspect directory entries, prepared page

</html>## Summary

While reviewing the memory preparation path in the AvatarManz fork, I identified two per-recording deduplication keys that discard significant bits of guest addresses.

Distinct guest addresses separated by multiples of 8 GiB produce identical keys. Consequently, preparing one address may suppress necessary preparation or copy-back registration for another address within the same command list.

The arithmetic collision is reproducible without title files, GPU execution or proprietary data.

A narrowly scoped candidate correction and regression tests are included in the attached archive.

1. Affected revision

Repository: avatarmanz/VIctory-7900XTX

Commit:

0dec5dcc228b6e0b7540d170c2dcd7d52e6d0b99

Affected files:

  • crates/victory-gpu/src/memory.rs
  • crates/victory-gpu/src/host.rs

2. Source-level evidence

In [memory.rs:989–1006](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/memory.rs#L989-L1006), the builder's write preparation is deduplicated using:

list.first_use(
    usize::MAX - (4 << 33)
    - (at >> 2 & 0x7FFF_FFFF) as usize
)

The corresponding small-buffer copy-back registration uses:

list.first_use(
    usize::MAX - (5 << 33)
    - (start >> 2 & 0x7FFF_FFFF) as usize
)

Both expressions retain only 31 bits of the shifted address.

The resulting collision period in byte addresses is:

2^(31 + 2) = 2^33 bytes = 8 GiB

This is not a hash collision resolved by the collection's equality check. The original addresses are converted into identical integer keys before insertion.

[HostList::first_use](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L7448-L7450) inserts these keys into the same per-recording set:

pub(crate) fn first_use(&self, key: usize) -> bool {
    self.deferred().textures.insert(key)
}

The second insertion returns false even when the original guest addresses are distinct.

3. Minimal arithmetic counterexample

Consider four synthetic guest addresses:

Guest address Location Masked address
0x1_0001_0000 4 GiB + 64 KiB 0x40004000
0x3_0001_0000 12 GiB + 64 KiB 0x40004000
0x5_0001_0000 20 GiB + 64 KiB 0x40004000
0x7_0001_0000 28 GiB + 64 KiB 0x40004000

For each operation kind, all four addresses produce the same deduplication key.

Expected admission:

true, true, true, true

Current key-based admission:

true, false, false, false

The same collision can occur in reverse recording order. Whichever address is prepared first suppresses the subsequent colliding addresses.

These are invented addresses demonstrating the arithmetic defect, not addresses captured from the title.

4. Potential consequences

The affected write-preparation branch controls several operations:

  • m.opens(at)
  • m.small(list, start, len)
  • m.ready(at, BUILT)

Their suppression may affect:

A. Write permissions

A distinct registered buffer may not receive its own opens operation.

Its pages could therefore remain read-only through the by-address memory path when the builder attempts to store into them.

B. Small-buffer copy-back

The second truncated key independently deduplicates the registration of small buffers whose builder-generated results must return to title memory.

Two distinct buffer starts separated by 8 GiB may suppress one another's copy-back registration.

C. Incomplete preparation of loose memory

The normal builder preparation requests BUILT, which is 4 MiB.

If the write-preparation branch is incorrectly skipped, the subsequent ordinary address preparation may request only VIEW, which is 256 KiB.

For two aligned, independent, nonpacked and previously unmapped loose-memory destinations, assuming successful mapping and no other preparation:

Preparation Bytes 64 KiB pages
Expected builder preparation 4 MiB 64
Possible fallback after collision 256 KiB 4
Difference 3.75 MiB 60

This 60-page difference is a conditional source-level consequence, not an observed GPU fault.

Existing mappings, packed structures or other preparation requests may prevent the coverage gap in a particular recording.

5. Proposed correction

Instead of encoding the operation kind and a truncated address into a shared integer key, use a dedicated typed key containing the complete guest byte address.

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub(crate) enum BuilderMemoryUse {
    Write(u64),
    Back(u64),
}

Maintain a separate per-recording set:

builder_memory: HashSet<BuilderMemoryUse>

Replace the affected calls with:

list.first_builder_memory_use(
    BuilderMemoryUse::Write(at)
)

and:

list.first_builder_memory_use(
    BuilderMemoryUse::Back(start)
)

This preserves:

  • Full guest address identity.
  • Separation between write preparation and copy-back registration.
  • Deduplication of genuinely repeated requests.
  • The existing per-recording lifetime.

The set is cleared by the existing reset mechanism:

*self.deferred() = Deferred::default();

See [host.rs:6527–6535](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L6527-L6535).

A separate typed set also avoids accidental overlap with unrelated texture and sentinel keys.

The candidate deliberately uses exact byte addresses rather than retaining the previous dword rounding. This could admit additional preparations for addresses within the same dword and should be considered during review.

6. Asset-free validation

The attached Python model covers 256 distinct synthetic addresses arranged into 16 independent deliberately colliding sequences.

Metric Current key model Proposed typed keys
Distinct address requests 256 256
Admitted requests 16 256
Incorrectly suppressed requests 240 0

All 13 Python unit tests passed.

The tests cover:

  • The 8 GiB collision period.
  • Distinct high address bits.
  • Repeated-address deduplication.
  • Separation of operation kinds.
  • Recording reset.
  • Reversed insertion order.
  • Address identity across the representable 40-bit domain.
  • Conditional page-coverage arithmetic.
  • Source transformation and patch-staging safeguards.

The test inputs were deliberately constructed to exercise collisions. These results do not estimate their frequency in the title.

7. Proposed Rust regression

The archive includes a candidate test-only addition alongside the Deferred implementation in host.rs.

Test name:

builder_memory_keys_keep_full_addresses_and_operation_kind

The test checks the original arithmetic collision as a negative control, then verifies that the proposed per-recording set:

  1. Admits distinct addresses separated by 8 GiB.
  2. Deduplicates exact repetitions.
  3. Distinguishes Write from Back.
  4. Keeps independent recordings separate.
  5. Admits the same addresses again after reset.

The proposed test does not require a GPU adapter or title assets.

The Rust implementation and regression have not yet been compiled or executed.

8. Reproduction and candidate integration

Python validation:

python model.py
python -m unittest -v test_model

The included prepare_patch.py script checks the exact upstream revision and normalized Git blob hashes before staging modifications to both affected source files.

On a dedicated checkout of the pinned revision:

python prepare_patch.py /path/to/checkout /path/to/staged

The script generates:

builder-memory-keys.patch
crates/victory-gpu/src/memory.rs
crates/victory-gpu/src/host.rs

Review the generated changes before applying them.

git apply --check /path/to/staged/builder-memory-keys.patch

Suggested native validation:

cargo test -p victory-gpu builder_memory_keys_keep_full_addresses_and_operation_kind -- --nocapture

cargo clippy -p victory-gpu --all-targets -- -D warnings

cargo xtask policy

The staging helper was tested on synthetic source-anchor fixtures. Full-checkout staging and native compilation remain pending.

9. Suggested end-to-end validation

An independent native test could allocate or register two eligible synthetic memory regions separated by 8 GiB.

Using the production memory::ready path within one recording:

  • Request builder write preparation for both addresses.
  • Inspect directory entries, prepared page

avatar_bvh_keys_audit.zip

**@⁠FunWithFlagsDev** on GitHub · 2026-11-26 11:26 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/202) <html> <body> <!--StartFragment--><h2><span>Summary</span></h2><p><span>While reviewing the memory preparation path in the AvatarManz fork, I identified two per-recording deduplication keys that discard significant bits of guest addresses.</span></p><p><span>Distinct guest addresses separated by multiples of 8 GiB produce identical keys. Consequently, preparing one address may suppress necessary preparation or copy-back registration for another address within the same command list.</span></p><p><span>The arithmetic collision is reproducible without title files, GPU execution or proprietary data.</span></p><p><span>A narrowly scoped candidate correction and regression tests are included in the attached archive.</span></p><h2><span>1. Affected revision</span></h2><p><span>Repository: </span><code><span>avatarmanz/VIctory-7900XTX</span></code></p><p><span>Commit:</span></p><p><code><span>0dec5dcc228b6e0b7540d170c2dcd7d52e6d0b99</span></code></p><p><span>Affected files:</span></p><ul><li><p><code><span>crates/victory-gpu/src/memory.rs</span></code></p></li><li><p><code><span>crates/victory-gpu/src/host.rs</span></code></p></li></ul><h2><span>2. Source-level evidence</span></h2><p><span>In </span><a href="https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/memory.rs#L989-L1006"><code><span>memory.rs:989–1006</span></code></a><span>, the builder's write preparation is deduplicated using:</span></p><pre><code><span>list.first_use( usize::MAX - (4 &lt;&lt; 33) - (at &gt;&gt; 2 &amp; 0x7FFF_FFFF) as usize )</span></code></pre><p><span>The corresponding small-buffer copy-back registration uses:</span></p><pre><code><span>list.first_use( usize::MAX - (5 &lt;&lt; 33) - (start &gt;&gt; 2 &amp; 0x7FFF_FFFF) as usize )</span></code></pre><p><span>Both expressions retain only 31 bits of the shifted address.</span></p><p><span>The resulting collision period in byte addresses is:</span></p><pre><code><span>2^(31 + 2) = 2^33 bytes = 8 GiB</span></code></pre><p><span>This is not a hash collision resolved by the collection's equality check. The original addresses are converted into identical integer keys before insertion.</span></p><p><a href="https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L7448-L7450"><code><span>HostList::first_use</span></code></a><span> inserts these keys into the same per-recording set:</span></p><pre><code><span>pub(crate) fn first_use(&amp;self, key: usize) -&gt; bool { self.deferred().textures.insert(key) }</span></code></pre><p><span>The second insertion returns false even when the original guest addresses are distinct.</span></p><h2><span>3. Minimal arithmetic counterexample</span></h2><p><span>Consider four synthetic guest addresses:</span></p> Guest address | Location | Masked address -- | -- | -- 0x1_0001_0000 | 4 GiB + 64 KiB | 0x40004000 0x3_0001_0000 | 12 GiB + 64 KiB | 0x40004000 0x5_0001_0000 | 20 GiB + 64 KiB | 0x40004000 0x7_0001_0000 | 28 GiB + 64 KiB | 0x40004000 <p><span>All 13 Python unit tests passed.</span></p><p><span>The tests cover:</span></p><ul><li><p><span>The 8 GiB collision period.</span></p></li><li><p><span>Distinct high address bits.</span></p></li><li><p><span>Repeated-address deduplication.</span></p></li><li><p><span>Separation of operation kinds.</span></p></li><li><p><span>Recording reset.</span></p></li><li><p><span>Reversed insertion order.</span></p></li><li><p><span>Address identity across the representable 40-bit domain.</span></p></li><li><p><span>Conditional page-coverage arithmetic.</span></p></li><li><p><span>Source transformation and patch-staging safeguards.</span></p></li></ul><p><span>The test inputs were deliberately constructed to exercise collisions. These results do not estimate their frequency in the title.</span></p><h2><span>7. Proposed Rust regression</span></h2><p><span>The archive includes a candidate test-only addition alongside the </span><code><span>Deferred</span></code><span> implementation in </span><code><span>host.rs</span></code><span>.</span></p><p><span>Test name:</span></p><p><code><span>builder_memory_keys_keep_full_addresses_and_operation_kind</span></code></p><p><span>The test checks the original arithmetic collision as a negative control, then verifies that the proposed per-recording set:</span></p><ol start="1"><li><p><span>Admits distinct addresses separated by 8 GiB.</span></p></li><li><p><span>Deduplicates exact repetitions.</span></p></li><li><p><span>Distinguishes </span><code><span>Write</span></code><span> from </span><code><span>Back</span></code><span>.</span></p></li><li><p><span>Keeps independent recordings separate.</span></p></li><li><p><span>Admits the same addresses again after reset.</span></p></li></ol><p><span>The proposed test does not require a GPU adapter or title assets.</span></p><p><span>The Rust implementation and regression have not yet been compiled or executed.</span></p><h2><span>8. Reproduction and candidate integration</span></h2><p><span>Python validation:</span></p><pre><code><span>python model.py python -m unittest -v test_model</span></code></pre><p><span>The included </span><code><span>prepare_patch.py</span></code><span> script checks the exact upstream revision and normalized Git blob hashes before staging modifications to both affected source files.</span></p><p><span>On a dedicated checkout of the pinned revision:</span></p><pre><code><span>python prepare_patch.py /path/to/checkout /path/to/staged</span></code></pre><p><span>The script generates:</span></p><pre><code><span>builder-memory-keys.patch crates/victory-gpu/src/memory.rs crates/victory-gpu/src/host.rs</span></code></pre><p><span>Review the generated changes before applying them.</span></p><pre><code><span>git apply --check /path/to/staged/builder-memory-keys.patch</span></code></pre><p><span>Suggested native validation:</span></p><pre><code><span>cargo test -p victory-gpu builder_memory_keys_keep_full_addresses_and_operation_kind -- --nocapture cargo clippy -p victory-gpu --all-targets -- -D warnings cargo xtask policy</span></code></pre><p><span>The staging helper was tested on synthetic source-anchor fixtures. Full-checkout staging and native compilation remain pending.</span></p><h2><span>9. Suggested end-to-end validation</span></h2><p><span>An independent native test could allocate or register two eligible synthetic memory regions separated by 8 GiB.</span></p><p><span>Using the production </span><code><span>memory::ready</span></code><span> path within one recording:</span></p><ul><li><p><span>Request builder write preparation for both addresses.</span></p></li><li><p><span>Inspect directory entries, prepared page</span></p></li></ul><!--EndFragment--> </body> </html>## Summary While reviewing the memory preparation path in the AvatarManz fork, I identified two per-recording deduplication keys that discard significant bits of guest addresses. Distinct guest addresses separated by multiples of 8 GiB produce identical keys. Consequently, preparing one address may suppress necessary preparation or copy-back registration for another address within the same command list. The arithmetic collision is reproducible without title files, GPU execution or proprietary data. A narrowly scoped candidate correction and regression tests are included in the attached archive. ## 1. Affected revision Repository: `avatarmanz/VIctory-7900XTX` Commit: `0dec5dcc228b6e0b7540d170c2dcd7d52e6d0b99` Affected files: - `crates/victory-gpu/src/memory.rs` - `crates/victory-gpu/src/host.rs` ## 2. Source-level evidence In [`[memory.rs:989–1006](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/memory.rs#L989-L1006)`](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/memory.rs#L989-L1006), the builder's write preparation is deduplicated using: ```rust list.first_use( usize::MAX - (4 << 33) - (at >> 2 & 0x7FFF_FFFF) as usize ) ``` The corresponding small-buffer copy-back registration uses: ```rust list.first_use( usize::MAX - (5 << 33) - (start >> 2 & 0x7FFF_FFFF) as usize ) ``` Both expressions retain only 31 bits of the shifted address. The resulting collision period in byte addresses is: ```text 2^(31 + 2) = 2^33 bytes = 8 GiB ``` This is not a hash collision resolved by the collection's equality check. The original addresses are converted into identical integer keys before insertion. [`[HostList::first_use](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L7448-L7450)`](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L7448-L7450) inserts these keys into the same per-recording set: ```rust pub(crate) fn first_use(&self, key: usize) -> bool { self.deferred().textures.insert(key) } ``` The second insertion returns false even when the original guest addresses are distinct. ## 3. Minimal arithmetic counterexample Consider four synthetic guest addresses: | Guest address | Location | Masked address | |---|---|---| | `0x1_0001_0000` | 4 GiB + 64 KiB | `0x40004000` | | `0x3_0001_0000` | 12 GiB + 64 KiB | `0x40004000` | | `0x5_0001_0000` | 20 GiB + 64 KiB | `0x40004000` | | `0x7_0001_0000` | 28 GiB + 64 KiB | `0x40004000` | For each operation kind, all four addresses produce the same deduplication key. Expected admission: ```text true, true, true, true ``` Current key-based admission: ```text true, false, false, false ``` The same collision can occur in reverse recording order. Whichever address is prepared first suppresses the subsequent colliding addresses. These are invented addresses demonstrating the arithmetic defect, not addresses captured from the title. ## 4. Potential consequences The affected write-preparation branch controls several operations: - `m.opens(at)` - `m.small(list, start, len)` - `m.ready(at, BUILT)` Their suppression may affect: ### A. Write permissions A distinct registered buffer may not receive its own `opens` operation. Its pages could therefore remain read-only through the by-address memory path when the builder attempts to store into them. ### B. Small-buffer copy-back The second truncated key independently deduplicates the registration of small buffers whose builder-generated results must return to title memory. Two distinct buffer starts separated by 8 GiB may suppress one another's copy-back registration. ### C. Incomplete preparation of loose memory The normal builder preparation requests `BUILT`, which is 4 MiB. If the write-preparation branch is incorrectly skipped, the subsequent ordinary address preparation may request only `VIEW`, which is 256 KiB. For two aligned, independent, nonpacked and previously unmapped loose-memory destinations, assuming successful mapping and no other preparation: | Preparation | Bytes | 64 KiB pages | |---|---:|---:| | Expected builder preparation | 4 MiB | 64 | | Possible fallback after collision | 256 KiB | 4 | | Difference | 3.75 MiB | 60 | This 60-page difference is a conditional source-level consequence, not an observed GPU fault. Existing mappings, packed structures or other preparation requests may prevent the coverage gap in a particular recording. ## 5. Proposed correction Instead of encoding the operation kind and a truncated address into a shared integer key, use a dedicated typed key containing the complete guest byte address. ```rust #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub(crate) enum BuilderMemoryUse { Write(u64), Back(u64), } ``` Maintain a separate per-recording set: ```rust builder_memory: HashSet<BuilderMemoryUse> ``` Replace the affected calls with: ```rust list.first_builder_memory_use( BuilderMemoryUse::Write(at) ) ``` and: ```rust list.first_builder_memory_use( BuilderMemoryUse::Back(start) ) ``` This preserves: - Full guest address identity. - Separation between write preparation and copy-back registration. - Deduplication of genuinely repeated requests. - The existing per-recording lifetime. The set is cleared by the existing reset mechanism: ```rust *self.deferred() = Deferred::default(); ``` See [`[host.rs:6527–6535](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L6527-L6535)`](https://github.com/avatarmanz/VIctory-7900XTX/blob/0dec5dcc/crates/victory-gpu/src/host.rs#L6527-L6535). A separate typed set also avoids accidental overlap with unrelated texture and sentinel keys. The candidate deliberately uses exact byte addresses rather than retaining the previous dword rounding. This could admit additional preparations for addresses within the same dword and should be considered during review. ## 6. Asset-free validation The attached Python model covers 256 distinct synthetic addresses arranged into 16 independent deliberately colliding sequences. | Metric | Current key model | Proposed typed keys | |---|---:|---:| | Distinct address requests | 256 | 256 | | Admitted requests | 16 | 256 | | Incorrectly suppressed requests | 240 | 0 | All 13 Python unit tests passed. The tests cover: - The 8 GiB collision period. - Distinct high address bits. - Repeated-address deduplication. - Separation of operation kinds. - Recording reset. - Reversed insertion order. - Address identity across the representable 40-bit domain. - Conditional page-coverage arithmetic. - Source transformation and patch-staging safeguards. The test inputs were deliberately constructed to exercise collisions. These results do not estimate their frequency in the title. ## 7. Proposed Rust regression The archive includes a candidate test-only addition alongside the `Deferred` implementation in `host.rs`. Test name: `builder_memory_keys_keep_full_addresses_and_operation_kind` The test checks the original arithmetic collision as a negative control, then verifies that the proposed per-recording set: 1. Admits distinct addresses separated by 8 GiB. 2. Deduplicates exact repetitions. 3. Distinguishes `Write` from `Back`. 4. Keeps independent recordings separate. 5. Admits the same addresses again after reset. The proposed test does not require a GPU adapter or title assets. The Rust implementation and regression have not yet been compiled or executed. ## 8. Reproduction and candidate integration Python validation: ```bash python model.py python -m unittest -v test_model ``` The included `prepare_patch.py` script checks the exact upstream revision and normalized Git blob hashes before staging modifications to both affected source files. On a dedicated checkout of the pinned revision: ```bash python prepare_patch.py /path/to/checkout /path/to/staged ``` The script generates: ```text builder-memory-keys.patch crates/victory-gpu/src/memory.rs crates/victory-gpu/src/host.rs ``` Review the generated changes before applying them. ```bash git apply --check /path/to/staged/builder-memory-keys.patch ``` Suggested native validation: ```bash cargo test -p victory-gpu builder_memory_keys_keep_full_addresses_and_operation_kind -- --nocapture cargo clippy -p victory-gpu --all-targets -- -D warnings cargo xtask policy ``` The staging helper was tested on synthetic source-anchor fixtures. Full-checkout staging and native compilation remain pending. ## 9. Suggested end-to-end validation An independent native test could allocate or register two eligible synthetic memory regions separated by 8 GiB. Using the production `memory::ready` path within one recording: - Request builder write preparation for both addresses. - Inspect directory entries, prepared page [avatar_bvh_keys_audit.zip](https://github.com/user-attachments/files/35461272/avatar_bvh_keys_audit.zip)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:30:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#202
No description provided.