D3D12.X: format_bytes returns 2 for 16-bit packed formats 133-136 (#1161) #1165

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

@⁠mahfuzinam0045-spec on GitHub · 2026-11-24 12:45 UTC · original
mahfuzinam0045-spec:fix/desc-format-bytes-packed-16bit → main · +13 −3 · 1 files · 1 commits · open

gpu::desc::format_bytes maps format numbers to element byte sizes (crates/xcl/src/gpu/desc.rs:662). It previously only covered format ranges 0–77 and fell back to 4 for unrecognized formats. Packed 16-bit GFX10 formats 133 (B5G6R5), 134 (B5G5R5A1, #946), and 136 (B4G4R4A4) have 2 bytes per element (as defined in gpu::tiling::element: 7..=19 | 133..=136 => (1, 1)).

Because format_bytes returned 4 for these formats, typed buffer views created with them received an element stride of 4 instead of 2 in buffer_words_at, and texture_memory calculated 32 bits instead of 16 bits per texel. format_bytes now maps 133..=136 to 2 and 130 | 132 to 4.

Fixes #1161.

What is in it

  • crates/xcl/src/gpu/desc.rs: in format_bytes, map packed 16-bit formats 133..=136 to 2 and 32-bit formats 130 | 132 to 4.
  • crates/xcl/src/gpu/desc.rs: add unit test format_bytes_covers_packed_16bit_and_32bit_formats checking element byte counts across standard, packed 16-bit, and 32-bit formats.

Tested

  • Windows 11 x64, Rust 1.98.1
  • Verified unit test format_bytes_covers_packed_16bit_and_32bit_formats asserting format_bytes returns 2 for B5G6R5_UNORM, B5G5R5A1_UNORM, and B4G4R4A4_UNORM (fails returning 4 on main without this change, passes with 2 with this change).
  • NVIDIA GeForce RTX 4060: full workspace test suite cargo test passes (751 passed, 0 failed, 45 ignored).

Regression run

  • RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s (courtesy of @⁠Anon64).

main 47efa2e:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1538 (PresentX 1538)
presents per 2 s (last 3): 57 25 10
device removals: 0
crashes: 0
peak commit: 24595 MB

this PR:

xcl-smoke v1
commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1452 (PresentX 1452)
presents per 2 s (last 3): 33 5 2
device removals: 0
crashes: 0
peak commit: 25839 MB

Not tested

  • Physical GPU execution of typed buffer loads with B5G6R5/B5G5R5A1/B4G4R4A4 views (covered by descriptor and format unit assertions).

AI use

  • Antigravity with Gemini 3.8 Flash investigated the issue, wrote the fix and unit test, and drafted this PR.
**@⁠mahfuzinam0045-spec** on GitHub · 2026-11-24 12:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165) `mahfuzinam0045-spec:fix/desc-format-bytes-packed-16bit` → `main` · +13 −3 · 1 files · 1 commits · open `gpu::desc::format_bytes` maps format numbers to element byte sizes (`crates/xcl/src/gpu/desc.rs:662`). It previously only covered format ranges 0–77 and fell back to 4 for unrecognized formats. Packed 16-bit GFX10 formats `133` (B5G6R5), `134` (B5G5R5A1, #946), and `136` (B4G4R4A4) have 2 bytes per element (as defined in `gpu::tiling::element`: `7..=19 | 133..=136 => (1, 1)`). Because `format_bytes` returned 4 for these formats, typed buffer views created with them received an element stride of 4 instead of 2 in `buffer_words_at`, and `texture_memory` calculated 32 bits instead of 16 bits per texel. `format_bytes` now maps `133..=136` to 2 and `130 | 132` to 4. Fixes #1161. **What is in it** - `crates/xcl/src/gpu/desc.rs`: in `format_bytes`, map packed 16-bit formats `133..=136` to 2 and 32-bit formats `130 | 132` to 4. - `crates/xcl/src/gpu/desc.rs`: add unit test `format_bytes_covers_packed_16bit_and_32bit_formats` checking element byte counts across standard, packed 16-bit, and 32-bit formats. **Tested** - Windows 11 x64, Rust 1.98.1 - Verified unit test `format_bytes_covers_packed_16bit_and_32bit_formats` asserting `format_bytes` returns 2 for `B5G6R5_UNORM`, `B5G5R5A1_UNORM`, and `B4G4R4A4_UNORM` (fails returning 4 on main without this change, passes with 2 with this change). - NVIDIA GeForce RTX 4060: full workspace test suite `cargo test` passes (751 passed, 0 failed, 45 ignored). **Regression run** - RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s (courtesy of @⁠Anon64). main `47efa2e`: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1538 (PresentX 1538) presents per 2 s (last 3): 57 25 10 device removals: 0 crashes: 0 peak commit: 24595 MB ``` this PR: ``` xcl-smoke v1 commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1452 (PresentX 1452) presents per 2 s (last 3): 33 5 2 device removals: 0 crashes: 0 peak commit: 25839 MB ``` **Not tested** - Physical GPU execution of typed buffer loads with B5G6R5/B5G5R5A1/B4G4R4A4 views (covered by descriptor and format unit assertions). **AI use** - Antigravity with Gemini 3.8 Flash investigated the issue, wrote the fix and unit test, and drafted this PR.
format_bytes only covered format ranges 0-77, falling back to 4 for unrecognized formats. Packed 16-bit GFX10 formats 133 (B5G6R5), 134 (B5G5R5A1), and 136 (B4G4R4A4) have 2 bytes per element (as defined in gpu::tiling::element).

Because format_bytes fell back to 4, typed buffer views created with these formats received a stride of 4 instead of 2 in buffer_words_at, and texture_memory calculated 32 bits instead of 16 bits per texel. Add 133..=136 (2 bytes) and 130/132 (4 bytes) to format_bytes, and add unit tests covering these format sizes.

Fixes #1161.

Assisted-by: Antigravity (Gemini 3.8 Flash)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:45:40 +00:00
Author
Owner

@⁠juliptree on GitHub · 2026-11-24 12:51 UTC · original

Independently reproduced #1161 on main@47efa2ecea0a12934719ae69b81930cf02a4b1c3. With only a regression test added, format_bytes returned [4, 4, 4] for formats 133, 134, and 136. The same test returned [2, 2, 2] after a local fix.

On an RTX 5060 Ti verified by adapter LUID, D3D12 GetCopyableFootprints reported 128 unpadded bytes per 64-texel row for B5G6R5, B5G5R5A1, and B4G4R4A4, confirming 2 bytes per texel for all three mappings.

This run used my local patch and synthetic fixtures. PR head, format 135, typed-buffer loads, and retail smoke remain outside this validation. Codex (GPT-6) assisted with testing and reporting.

**@⁠juliptree** on GitHub · 2026-11-24 12:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7132017096) Independently reproduced #1161 on main@47efa2ecea0a12934719ae69b81930cf02a4b1c3. With only a regression test added, format_bytes returned [4, 4, 4] for formats 133, 134, and 136. The same test returned [2, 2, 2] after a local fix. On an RTX 5060 Ti verified by adapter LUID, D3D12 GetCopyableFootprints reported 128 unpadded bytes per 64-texel row for B5G6R5, B5G5R5A1, and B4G4R4A4, confirming 2 bytes per texel for all three mappings. This run used my local patch and synthetic fixtures. PR head, format 135, typed-buffer loads, and retail smoke remain outside this validation. Codex (GPT-6) assisted with testing and reporting.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 12:52 UTC · original

Regression run for this PR: head c2bdbf5, based on main 47efa2e. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s.

Tested

  • cargo test -p xcl --release --lib -- format_bytes on c2bdbf5: 1 passed, 0 failed.

main 47efa2e:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1538 (PresentX 1538)
presents per 2 s (last 3): 57 25 10
device removals: 0
crashes: 0
peak commit: 24595 MB

this PR:

xcl-smoke v1
commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1452 (PresentX 1452)
presents per 2 s (last 3): 33 5 2
device removals: 0
crashes: 0
peak commit: 25839 MB

No device removals or crashes; 94 % of main's frames, 105 % of its peak commit.

Not tested: the whole suite; whether the title reaches the changed path in these 60 s.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 12:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7132036645) Regression run for this PR: head `c2bdbf5`, based on `main` `47efa2e`. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s. **Tested** - `cargo test -p xcl --release --lib -- format_bytes` on `c2bdbf5`: 1 passed, 0 failed. main `47efa2e`: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1538 (PresentX 1538) presents per 2 s (last 3): 57 25 10 device removals: 0 crashes: 0 peak commit: 24595 MB ``` this PR: ``` xcl-smoke v1 commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1452 (PresentX 1452) presents per 2 s (last 3): 33 5 2 device removals: 0 crashes: 0 peak commit: 25839 MB ``` No device removals or crashes; 94 % of main's frames, 105 % of its peak commit. **Not tested:** the whole suite; whether the title reaches the changed path in these 60 s. Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 14:21 UTC · original

A regression run under Wine on Linux, on a retail title.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. c2bdbf5 as it is (merge base 47efa2e) and main 47efa2e, no uncommitted changes. Retail title 1.0.2.1, scripts/linux/smoke.sh (#257) for 60 s, no input. Twelve runs in a row, main first and last, other PRs in between.
  • A regression check: I did not check whether GTA VI reaches the changed code in these 60 s.

Regression run

main (first run):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1384 (PresentX 1384)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1405 (PresentX 1405)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

The last main run: 1425 frames, exit: 0x0, no device removal, no crash. Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • the test suite on this head; native Windows; AMD.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 14:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7134244500) A regression run under Wine on Linux, on a retail title. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `c2bdbf5` as it is (merge base `47efa2e`) and `main` `47efa2e`, no uncommitted changes. Retail title 1.0.2.1, `scripts/linux/smoke.sh` (#257) for 60 s, no input. Twelve runs in a row, `main` first and last, other PRs in between. - A regression check: I did not check whether GTA VI reaches the changed code in these 60 s. **Regression run** main (first run): ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1384 (PresentX 1384) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` this PR: ``` xcl-smoke v1 commit: c2bdbf51f2e62df1ab2e0fbfacdf4a0336f5ee0b gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1405 (PresentX 1405) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` The last `main` run: 1425 frames, `exit: 0x0`, no device removal, no crash. Under Wine, `peak commit` reads 0 MB, so these blocks do not check memory. **Not tested** - the test suite on this head; native Windows; AMD. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠mahfuzinam0045-spec on GitHub · 2026-11-24 15:26 UTC · original

Additional testing: Windows / NVIDIA RTX 4060

I ran the full test suite locally on Windows after building the workspace.

Test environment

  • OS: Windows
  • GPU: NVIDIA GeForce RTX 4060 (7,956 MiB reported VRAM)
  • GPU backend: D3D12 (real)
  • Build command: cargo build --workspace
  • Test command: cargo test

Build result

cargo build --workspace completed successfully.

Test results

Unit tests

  • 707 passed
  • 0 failed
  • 21 ignored

Integration tests

  • 44 passed
  • 0 failed

Notable integration results:

  • Console DLL E2E: 13/13 passed
  • General E2E: 3/3 passed
  • GPU compute E2E: 3/3 passed
  • GPU PSO E2E: 7/7 passed
  • Console shaders: 3 passed, 4 ignored
  • XG oracle: 6 passed, 12 ignored

GPU testing

The real D3D12 backend initialized successfully on the NVIDIA RTX 4060.

GPU-related unit tests passed, including:

  • gpu_typed_buffer_loads_and_stores
  • gpu_images_sample_load_store_atomic
  • gpu_images_a16_d16
  • gpu_tsharp_to_d3d12_resources
  • gpu_format_stores_atomics_global_lds
  • gpu_console_format_allocation_info_is_sane
  • gpu_console_depth_formats_are_supported

The GPU compute and PSO integration suites also completed without failures.

Previously failing E2E test

The previously failing test:

test_title_runs_and_game_folder_is_untouched

now passes after running cargo build --workspace first. All three tests in tests/e2e.rs passed.

Conclusion

The complete cargo test run finished successfully:

  • 751 tests passed
  • 0 tests failed
  • 45 tests ignored across the unit and integration suites

This provides positive regression-testing evidence on a real NVIDIA D3D12 backend, including GPU resource, compute, and PSO paths.

Scope note: These results validate the broader GPU and resource functionality. They do not independently verify the exact format_bytes return value for each affected format (133–136).

**@⁠mahfuzinam0045-spec** on GitHub · 2026-11-24 15:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7136028962) ## Additional testing: Windows / NVIDIA RTX 4060 I ran the full test suite locally on Windows after building the workspace. ### Test environment - OS: Windows - GPU: NVIDIA GeForce RTX 4060 (7,956 MiB reported VRAM) - GPU backend: D3D12 (`real`) - Build command: `cargo build --workspace` - Test command: `cargo test` ### Build result `cargo build --workspace` completed successfully. ### Test results **Unit tests** - 707 passed - 0 failed - 21 ignored **Integration tests** - 44 passed - 0 failed Notable integration results: - Console DLL E2E: 13/13 passed - General E2E: 3/3 passed - GPU compute E2E: 3/3 passed - GPU PSO E2E: 7/7 passed - Console shaders: 3 passed, 4 ignored - XG oracle: 6 passed, 12 ignored ### GPU testing The real D3D12 backend initialized successfully on the NVIDIA RTX 4060. GPU-related unit tests passed, including: - `gpu_typed_buffer_loads_and_stores` - `gpu_images_sample_load_store_atomic` - `gpu_images_a16_d16` - `gpu_tsharp_to_d3d12_resources` - `gpu_format_stores_atomics_global_lds` - `gpu_console_format_allocation_info_is_sane` - `gpu_console_depth_formats_are_supported` The GPU compute and PSO integration suites also completed without failures. ### Previously failing E2E test The previously failing test: `test_title_runs_and_game_folder_is_untouched` now passes after running `cargo build --workspace` first. All three tests in `tests/e2e.rs` passed. ### Conclusion The complete `cargo test` run finished successfully: - **751 tests passed** - **0 tests failed** - 45 tests ignored across the unit and integration suites This provides positive regression-testing evidence on a real NVIDIA D3D12 backend, including GPU resource, compute, and PSO paths. **Scope note:** These results validate the broader GPU and resource functionality. They do not independently verify the exact `format_bytes` return value for each affected format (133–136).
Author
Owner

@⁠kacper-serewis on GitHub · 2026-11-24 20:41 UTC · original

Halving the element size also halves the address space texture_memory reserves for a committed texture. For 2048x130 in B5G6R5, B5G5R5A1 and B4G4R4A4 it becomes smaller than the 64KB_S layout (c2bdbf5).

Tested: Windows 11, debug, CPU only.

format base 47efa2e c2bdbf5 64KB_S layout (xg::Texture)
B5G6R5, B5G5R5A1, B4G4R4A4 0x170000 0xC0000 0x100000
R16_UNORM (for comparison) 0xC0000 0xC0000 0x100000

So the estimate is already short for 16-bit texels on the base; the old four-byte size hid it for these three formats. Suggested: in texture_memory, reserve at least the largest console layout of the texture that fits.

Not tested: writing through the reservation; the test repeats the formula of texture_memory with the PR's format_bytes. The suggestion was not applied to this PR's head.

Test (append to real.rs)
#[cfg(test)]
mod reserve_probe {
    #[test]
    fn packed_16bit_reservation() {
        use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT;
        let mut bad = vec![];
        for f in [85u32, 86, 115, 56] {
            let (w, h) = (2048u64, 130u64);
            // res_gpu_va_x / texture_memory's formula, unchanged by the PR
            let bits = crate::gpu::desc::gfx10_format(DXGI_FORMAT(f as i32)).map_or(128, |f| crate::gpu::desc::format_bytes(f).max(1) as u64 * 8);
            let reserved = (w * h * bits / 8 * 4 / 3 + 0x1_0000).next_multiple_of(0x1_0000);
            let mut x = [0u8; 0x38];
            x[0..4].copy_from_slice(&3i32.to_le_bytes());
            x[0x10..0x18].copy_from_slice(&w.to_le_bytes());
            x[0x18..0x1C].copy_from_slice(&(h as u32).to_le_bytes());
            x[0x1C..0x1E].copy_from_slice(&1u16.to_le_bytes());
            x[0x1E..0x20].copy_from_slice(&1u16.to_le_bytes());
            x[0x20..0x24].copy_from_slice(&f.to_le_bytes());
            x[0x24..0x28].copy_from_slice(&1u32.to_le_bytes());
            x[0x2C..0x30].copy_from_slice(&0x109u32.to_le_bytes());
            let layout = crate::hle::xg::Texture::new(&x).unwrap_or_else(|e| panic!("{e:#x}")).size();
            println!("format {f}: reserved {reserved:#x}, 64KB_S layout {layout:#x}");
            if reserved < layout { bad.push(f); }
        }
        assert!(bad.is_empty(), "{bad:?}");
    }
}

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. I checked the reservation claim in an earlier version of this comment; the R16_UNORM comparison was added after that, and no person has checked it.

**@⁠kacper-serewis** on GitHub · 2026-11-24 20:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7143919196) Halving the element size also halves the address space `texture_memory` reserves for a committed texture. For 2048x130 in B5G6R5, B5G5R5A1 and B4G4R4A4 it becomes smaller than the 64KB_S layout (`c2bdbf5`). **Tested:** Windows 11, debug, CPU only. | format | base `47efa2e` | `c2bdbf5` | 64KB_S layout (`xg::Texture`) | |---|---|---|---| | B5G6R5, B5G5R5A1, B4G4R4A4 | 0x170000 | **0xC0000** | 0x100000 | | R16_UNORM (for comparison) | 0xC0000 | 0xC0000 | 0x100000 | So the estimate is already short for 16-bit texels on the base; the old four-byte size hid it for these three formats. Suggested: in `texture_memory`, reserve at least the largest console layout of the texture that fits. **Not tested:** writing through the reservation; the test repeats the formula of `texture_memory` with the PR's `format_bytes`. The suggestion was not applied to this PR's head. <details><summary>Test (append to real.rs)</summary> ```rust #[cfg(test)] mod reserve_probe { #[test] fn packed_16bit_reservation() { use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT; let mut bad = vec![]; for f in [85u32, 86, 115, 56] { let (w, h) = (2048u64, 130u64); // res_gpu_va_x / texture_memory's formula, unchanged by the PR let bits = crate::gpu::desc::gfx10_format(DXGI_FORMAT(f as i32)).map_or(128, |f| crate::gpu::desc::format_bytes(f).max(1) as u64 * 8); let reserved = (w * h * bits / 8 * 4 / 3 + 0x1_0000).next_multiple_of(0x1_0000); let mut x = [0u8; 0x38]; x[0..4].copy_from_slice(&3i32.to_le_bytes()); x[0x10..0x18].copy_from_slice(&w.to_le_bytes()); x[0x18..0x1C].copy_from_slice(&(h as u32).to_le_bytes()); x[0x1C..0x1E].copy_from_slice(&1u16.to_le_bytes()); x[0x1E..0x20].copy_from_slice(&1u16.to_le_bytes()); x[0x20..0x24].copy_from_slice(&f.to_le_bytes()); x[0x24..0x28].copy_from_slice(&1u32.to_le_bytes()); x[0x2C..0x30].copy_from_slice(&0x109u32.to_le_bytes()); let layout = crate::hle::xg::Texture::new(&x).unwrap_or_else(|e| panic!("{e:#x}")).size(); println!("format {f}: reserved {reserved:#x}, 64KB_S layout {layout:#x}"); if reserved < layout { bad.push(f); } } assert!(bad.is_empty(), "{bad:?}"); } } ``` </details> **AI use:** Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. I checked the reservation claim in an earlier version of this comment; the R16_UNORM comparison was added after that, and no person has checked it.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 07:46 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 07:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/1165#issuecomment-7156243714) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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