Quantize RGB565 render-target clears at each channel width #2268

Closed
Bonchaloo wants to merge 1 commit from upstream-pr/2268 into main
Bonchaloo commented 2026-11-26 11:52:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Bonchaloo on 2026-11-26T11:52:27Z.


Claimed in the coordination issue as RT-CLEAR-RGB565-UNORM.

What and why

The RTV replay path already pre-rounds normalized clear values so the conversion is independent of the driver’s tie handling. RGB565 fell through to the raw float path. Apply the existing converter with channel maxima of 31, 63 and 31. Cover full and rectangle clears, midpoint rounding, NaN and clamping.

Tested

On the parent revision the new midpoint case failed (red 0.5, expected 16/31). With the change all 519 clear replay checks passed. The no-game-data check passed for both changed files.

GPUs tested: Apple M5 Max, Apple Metal driver on macOS 27.3. A separate native Metal RGB565 clear and readback produced 0x8410 for both the raw and pre-rounded midpoint. That device already rounds this case the same way. The failing regression was at the renderer’s Vulkan command boundary; the replay test uses synthetic inputs and captures the clear without a GPU.

Full native runtime CTest suite on Apple M5 Max with MoltenVK 1.4.2: 105 passed, 0 failed, 3 skipped (shader_library_corpus, vk_device_markers, vk_sync_validation).

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5509525843 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268). Originally posted by [Bonchaloo](https://github.com/Bonchaloo) on 2026-11-26T11:52:27Z. --- Claimed in the coordination issue as [RT-CLEAR-RGB565-UNORM](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191106625). ### What and why The RTV replay path already pre-rounds normalized clear values so the conversion is independent of the driver’s tie handling. RGB565 fell through to the raw float path. Apply the existing converter with channel maxima of 31, 63 and 31. Cover full and rectangle clears, midpoint rounding, NaN and clamping. ### Tested On the parent revision the new midpoint case failed (red 0.5, expected 16/31). With the change all 519 clear replay checks passed. The no-game-data check passed for both changed files. GPUs tested: Apple M5 Max, Apple Metal driver on macOS 27.3. A separate native Metal RGB565 clear and readback produced 0x8410 for both the raw and pre-rounded midpoint. That device already rounds this case the same way. The failing regression was at the renderer’s Vulkan command boundary; the replay test uses synthetic inputs and captures the clear without a GPU. Full native runtime CTest suite on Apple M5 Max with MoltenVK 1.4.2: 105 passed, 0 failed, 3 skipped (shader_library_corpus, vk_device_markers, vk_sync_validation). AI-assisted: yes.
Bonchaloo commented 2026-11-26 12:21:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Bonchaloo on 2026-11-26T12:21:10Z.


My Discord username is bonchalo.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7191891558 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2268#issuecomment-7191891558). Originally posted by [Bonchaloo](https://github.com/Bonchaloo) on 2026-11-26T12:21:10Z. --- My Discord username is `bonchalo`.
real-rusher commented 2026-11-26 12:23:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T12:23:59Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, GCC 13.3, CMake 3.28, Ninja, no GPU). Merges cleanly. ctest -R '^clear_color$' passes with this PR; the PR's runtime/test/clear_color_test.cpp built against main's vulkan_replay.h fails, so the new case fails on main and passes with the change.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7191950807 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2268#issuecomment-7191950807). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T12:23:59Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, GCC 13.3, CMake 3.28, Ninja, no GPU). Merges cleanly. ctest -R '^clear_color$' passes with this PR; the PR's runtime/test/clear_color_test.cpp built against main's vulkan_replay.h fails, so the new case fails on main and passes with the change. AI-assisted: yes (Claude Code)
ecox982745 commented 2026-11-26 12:49:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-26T12:49:34Z.


Confirmed that the patch changes the stored RGB565 bits on an RTX 4090. For an RGB clear of (0.5, 0.5, 0.5), the Vulkan layer wrote 0x7bef on parent a73a57e13 and 0x8410 on head 1e0de21b0. The head matches the proposed nearest-even conversion, (16, 32, 16). Native D3D12 on the same card wrote 0x7bef, and Microsoft WARP wrote 0x8410.

I exercised ClearRenderTargetView through the D3D12 layer on Windows 11, NVIDIA 616.64, with Khronos validation. The same test-only probe ran on both revisions. It covered 199 input vectors, including primaries, clamping, NaN, and the float32 values at and immediately around the 5- and 6-bit rounding thresholds. Each input was used once as a whole-target clear and once as a rectangular clear on a 5×3 image. Every texel inside and outside the rectangle was checked.

Readback path Packed words matching nearest-even after exact scaling Packed words matching nearest-even after float32 scaling
Leonida Vulkan, parent 8/199 8/199
Leonida Vulkan, PR head 199/199 137/199
Native D3D12, RTX 4090 8/199 8/199
Native D3D12, WARP 137/199 199/199

Here “exact scaling” means multiplying each supplied float32 by 31, 63 or 31 in double precision before rounding. “Float32 scaling” rounds that product to float32 first. The WARP result is an observation on this build. The two calculations can pick neighboring codes near a half-step. The 62 head/WARP disagreements were at most one code per channel. These inputs deliberately concentrate on thresholds, so the counts describe this test set.

The full and rectangular readbacks agreed across all paths. Repeating the matrix gave identical results and no Vulkan validation errors. The PR's 519 CPU replay checks also passed. This verifies the layer's stated rounding rule on a Vulkan device where the midpoint changes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7192510670 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2268#issuecomment-7192510670). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-11-26T12:49:34Z. --- Confirmed that the patch changes the stored RGB565 bits on an RTX 4090. For an RGB clear of (0.5, 0.5, 0.5), the Vulkan layer wrote `0x7bef` on parent `a73a57e13` and `0x8410` on head `1e0de21b0`. The head matches the proposed nearest-even conversion, (16, 32, 16). Native D3D12 on the same card wrote `0x7bef`, and Microsoft WARP wrote `0x8410`. I exercised `ClearRenderTargetView` through the D3D12 layer on Windows 11, NVIDIA 616.64, with Khronos validation. The same test-only probe ran on both revisions. It covered 199 input vectors, including primaries, clamping, NaN, and the float32 values at and immediately around the 5- and 6-bit rounding thresholds. Each input was used once as a whole-target clear and once as a rectangular clear on a 5×3 image. Every texel inside and outside the rectangle was checked. | Readback path | Packed words matching nearest-even after exact scaling | Packed words matching nearest-even after float32 scaling | | --- | ---: | ---: | | Leonida Vulkan, parent | 8/199 | 8/199 | | Leonida Vulkan, PR head | **199/199** | 137/199 | | Native D3D12, RTX 4090 | 8/199 | 8/199 | | Native D3D12, WARP | 137/199 | **199/199** | Here “exact scaling” means multiplying each supplied float32 by 31, 63 or 31 in double precision before rounding. “Float32 scaling” rounds that product to float32 first. The WARP result is an observation on this build. The two calculations can pick neighboring codes near a half-step. The 62 head/WARP disagreements were at most one code per channel. These inputs deliberately concentrate on thresholds, so the counts describe this test set. The full and rectangular readbacks agreed across all paths. Repeating the matrix gave identical results and no Vulkan validation errors. The PR's 519 CPU replay checks also passed. This verifies the layer's stated rounding rule on a Vulkan device where the midpoint changes.
Bonchaloo commented 2026-11-26 13:55:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Bonchaloo on 2026-11-26T13:55:54Z.


Ready for maintainer review. The RTX 4090 readback confirms the patch applies Leonida’s existing normalized-clear rounding rule. Native D3D12 on that GPU and WARP differed near rounding thresholds, as documented above. Is the existing Leonida rule the intended behavior for RGB565?

The fork CI run reports action_required with zero jobs. Could a maintainer approve it if CI is wanted for review? The M5 Max suite completed with 105 passed and 3 skipped.

I’ve kept the independent viewport fix (#2271) in draft. Should it enter review now or after this one lands?

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7194036773 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2268#issuecomment-7194036773). Originally posted by [Bonchaloo](https://github.com/Bonchaloo) on 2026-11-26T13:55:54Z. --- Ready for maintainer review. The RTX 4090 readback confirms the patch applies Leonida’s existing normalized-clear rounding rule. Native D3D12 on that GPU and WARP differed near rounding thresholds, as documented above. Is the existing Leonida rule the intended behavior for RGB565? The fork CI run reports action_required with zero jobs. Could a maintainer approve it if CI is wanted for review? The M5 Max suite completed with 105 passed and 3 skipped. I’ve kept the independent viewport fix (#2271) in draft. Should it enter review now or after this one lands? AI-assisted: yes.
lixonik commented 2026-11-28 08:42:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T08:42:13Z.

Review: APPROVED


Reviewed and tested merged onto main (493867366) on Windows 11 (MSVC 19.44, Ninja Release).

  • Adding VK_FORMAT_R5G6B5_UNORM_PACK16 with {31, 63, 31, 0} channel widths to render_target_clear_color() accurately quantizes DXGI_FORMAT_B5G6R5_UNORM clears per channel (and complements the other 16-bit packed UNORM formats in #2479 without overlap).
  • Built clear_color_test and ran ctest --output-on-failure -V -R ^clear_color$: 1/1 passed (519 checks, 0.02 s).

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6096804367 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#pullrequestreview-6096804367). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T08:42:13Z. **Review:** APPROVED --- Reviewed and tested merged onto `main` (`493867366`) on Windows 11 (MSVC 19.44, Ninja Release). - Adding `VK_FORMAT_R5G6B5_UNORM_PACK16` with `{31, 63, 31, 0}` channel widths to `render_target_clear_color()` accurately quantizes `DXGI_FORMAT_B5G6R5_UNORM` clears per channel (and complements the other 16-bit packed UNORM formats in #2479 without overlap). - Built `clear_color_test` and ran `ctest --output-on-failure -V -R ^clear_color$`: 1/1 passed (519 checks, 0.02 s). AI-assisted (Antigravity, Gemini).
zmasi commented 2026-11-28 21:02:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:02:37Z.


This changes stored RGB565 pixels on physical gfx906 (RADV Mesa 26.0.8), but not at the exact midpoint. Comparing main 1bc055e6c with 1e0de21b0 merged into it, both stored 0x8410 for RGB (0.5, 0.5, 0.5). With inputs one representable float above the tested channel thresholds, main stored (3,45,21) / 0x1db5; the merge stored the expected (4,46,22) / 0x25d6. Just below those thresholds both stored 0x1db5.

The difference covered all 315 pixels of the full clear and all 88 pixels inside the rectangle. Across 30 finite clears, the merge matched all 6,045 fill pixels; main missed 403. All 3,405 outside-rectangle pixels stayed unchanged. The identical replay unit test also went from a midpoint command-value failure to 519 checks passing. No validation errors or synchronization hazards; NaN cases were checked at the command boundary only. This verifies the runtime’s nearest-even rule, not a universal native D3D12 tie rule.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245729756 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7245729756). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:02:37Z. --- This changes stored RGB565 pixels on physical gfx906 (RADV Mesa 26.0.8), but not at the exact midpoint. Comparing main `1bc055e6c` with `1e0de21b0` merged into it, both stored `0x8410` for RGB `(0.5, 0.5, 0.5)`. With inputs one representable float above the tested channel thresholds, main stored `(3,45,21)` / `0x1db5`; the merge stored the expected `(4,46,22)` / `0x25d6`. Just below those thresholds both stored `0x1db5`. The difference covered all 315 pixels of the full clear and all 88 pixels inside the rectangle. Across 30 finite clears, the merge matched all 6,045 fill pixels; main missed 403. All 3,405 outside-rectangle pixels stayed unchanged. The identical replay unit test also went from a midpoint command-value failure to 519 checks passing. No validation errors or synchronization hazards; NaN cases were checked at the command boundary only. This verifies the runtime’s nearest-even rule, not a universal native D3D12 tie rule. AI-assisted.
timbot103 commented 2026-11-29 04:29:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:29:45Z.

Review: COMMENTED


Reviewed head 1e0de21b0 from the supplied diff against b6bf3aa0b. Static audit only. I ran no builds, tests, or GPU workloads.

  • runtime/shims/d3d12_vulkan_device.cpp:2454 maps DXGI_FORMAT_B5G6R5_UNORM to VK_FORMAT_R5G6B5_UNORM_PACK16. Clear inputs stay in logical RGBA order, and the packed word places red in bits 11–15, green in bits 5–10, and blue in bits 0–4. The new maxima of 31, 63, and 31 match that layout. The fourth float is passed through, and the format has no alpha channel. Both vkCmdClearColorImage and vkCmdClearAttachments receive the converted value from runtime/src/vulkan_replay.h.
  • The shared converter sends NaN, nonpositive values, and negative infinity to zero, and sends values at or above one, including positive infinity, to one. For finite in-range float32 inputs, the double-precision product is rounded to nearest, ties to even. At these scales the only exactly representable half-step input is 0.5, where half-up and nearest-even both yield codes 16, 32, and 16. Vulkan receives floats representing the selected codes away from the half-step boundaries. The supplied native D3D12 measurements differ across drivers near thresholds, consistent with the variation documented in docs/d3d12_vulkan.md:272.
  • runtime/test/clear_color_test.cpp:140 exercises the midpoint, NaN, and clamping through both replay callbacks. The midpoint assertion detects the original float passthrough. The existing packed readback check in runtime/test/d3d12_vulkan_device_test.cpp:6015 covers the red and blue bit positions for whole and rectangular clears. The change uses an existing Vulkan format constant and standard C++ in the same CTest target for Windows/MSVC and Linux.
  • Both patch hunks fit b6bf3aa0b. The packed-format change at e7d11f0da discussed as #2479 adds RGB5551 and RGBA4444 cases and updates the RGBA4444 fallback. Its switch and test additions are at distinct insertion points from the RGB565 changes. The merge labeled #2479 in the supplied main history is d09752898 and changes Wine test tooling only.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101402730 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#pullrequestreview-6101402730). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:29:45Z. **Review:** COMMENTED --- Reviewed head `1e0de21b0` from the supplied diff against `b6bf3aa0b`. Static audit only. I ran no builds, tests, or GPU workloads. - `runtime/shims/d3d12_vulkan_device.cpp:2454` maps `DXGI_FORMAT_B5G6R5_UNORM` to `VK_FORMAT_R5G6B5_UNORM_PACK16`. Clear inputs stay in logical RGBA order, and the packed word places red in bits 11–15, green in bits 5–10, and blue in bits 0–4. The new maxima of 31, 63, and 31 match that layout. The fourth float is passed through, and the format has no alpha channel. Both `vkCmdClearColorImage` and `vkCmdClearAttachments` receive the converted value from `runtime/src/vulkan_replay.h`. - The shared converter sends NaN, nonpositive values, and negative infinity to zero, and sends values at or above one, including positive infinity, to one. For finite in-range float32 inputs, the double-precision product is rounded to nearest, ties to even. At these scales the only exactly representable half-step input is 0.5, where half-up and nearest-even both yield codes 16, 32, and 16. Vulkan receives floats representing the selected codes away from the half-step boundaries. The supplied native D3D12 measurements differ across drivers near thresholds, consistent with the variation documented in `docs/d3d12_vulkan.md:272`. - `runtime/test/clear_color_test.cpp:140` exercises the midpoint, NaN, and clamping through both replay callbacks. The midpoint assertion detects the original float passthrough. The existing packed readback check in `runtime/test/d3d12_vulkan_device_test.cpp:6015` covers the red and blue bit positions for whole and rectangular clears. The change uses an existing Vulkan format constant and standard C++ in the same CTest target for Windows/MSVC and Linux. - Both patch hunks fit `b6bf3aa0b`. The packed-format change at `e7d11f0da` discussed as #2479 adds RGB5551 and RGBA4444 cases and updates the RGBA4444 fallback. Its switch and test additions are at distinct insertion points from the RGB565 changes. The merge labeled #2479 in the supplied main history is `d09752898` and changes Wine test tooling only. AI-assisted.
OreoFR commented 2026-11-29 14:58:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T14:58:08Z.


TAKEN by OreoFR (Windows, RTX 4070 8 GB)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257715633 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7257715633). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T14:58:08Z. --- TAKEN by OreoFR (Windows, RTX 4070 8 GB)
OreoFR commented 2026-11-29 21:33:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T21:33:04Z.


Verified by OreoFR — READY

  • Base: main c22a0a732 + this PR (head 1e0de21b0) merged with --no-ff
  • Red (main + only this PR's test): clear_color fails on main: normalised clear: format 4 rect 0 channel 0: got 0.5, expected 0.516129017 (R5G6B5 is not quantized at 5/6/5 bits).
  • Green (merge): clear_color passes; ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p1 = main + #2198 + #2333 + #2308 + #2268 (no shared files): 506 tests, new failures vs main: none. d3d12_queue_wait_timeout, d3d12_pipeline_workers and dxgi_waitable_latency failed in the parallel run and pass when re-run alone (main alone: 505 tests, 6 failures: big_compile_gate and api_ref_state and d3d12_queue_wait_timeout timeouts, xs_proxy_mock, vk_compile_gate_calibration, xbox_present; xbox_present fails in every package as on main)
  • gta6rt.exe links without the XMA decoder (LEONIDA_CARGO=OFF, LEONIDA_XMA2_DECODER_LIB empty) in package p1; imports unchanged vs main (25 DLLs, 755 functions, no WS2_32)
  • Diff read: no issue. One case added to render_target_clear_color, with the 31/63/31 maxima of R5G6B5.
  • Other runs: Consistent with real-rusher's, ecox982745's and zmasi's runs and lixonik's approval.
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

Ready to merge per the maintainers' plan.

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7262964330 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7262964330). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T21:33:04Z. --- **Verified by OreoFR** — READY - Base: main c22a0a732 + this PR (head 1e0de21b0) merged with --no-ff - Red (main + only this PR's test): `clear_color` fails on main: `normalised clear: format 4 rect 0 channel 0: got 0.5, expected 0.516129017` (R5G6B5 is not quantized at 5/6/5 bits). - Green (merge): `clear_color` passes; ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p1 = main + #2198 + #2333 + #2308 + #2268 (no shared files): 506 tests, new failures vs main: none. `d3d12_queue_wait_timeout`, `d3d12_pipeline_workers` and `dxgi_waitable_latency` failed in the parallel run and pass when re-run alone (main alone: 505 tests, 6 failures: big_compile_gate and api_ref_state and d3d12_queue_wait_timeout timeouts, xs_proxy_mock, vk_compile_gate_calibration, xbox_present; xbox_present fails in every package as on main) - gta6rt.exe links without the XMA decoder (`LEONIDA_CARGO=OFF`, `LEONIDA_XMA2_DECODER_LIB` empty) in package p1; imports unchanged vs main (25 DLLs, 755 functions, no WS2_32) - Diff read: no issue. One case added to `render_target_clear_color`, with the 31/63/31 maxima of R5G6B5. - Other runs: Consistent with real-rusher's, ecox982745's and zmasi's runs and lixonik's approval. - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 Ready to merge per the maintainers' plan. AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
fiestorra commented 2026-11-30 10:37:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T10:37:52Z.


Independent verification on this machine (Windows 11, MSVC 19.44.35226), with a negative control that bites on a numeric mismatch.

1. It applies. merge-tree clean; the commits cherry-pick onto main 012b79a67 without a conflict. Two files: runtime/src/vulkan_replay.h and runtime/test/clear_color_test.cpp.

2. With the branch its test passes:

ctest -R 'clear_color'
100% tests passed, 0 tests failed out of 1

3. The control - revert only the header, keep the test:

git checkout origin/main -- runtime/src/vulkan_replay.h
cmake --build … --target clear_color_test
ctest -R 'clear_color' --output-on-failure
0% tests passed, 1 tests failed out of 1
normalised clear: format 4 rect 0 channel 0: got 0.5, expected 0.516129017

The mismatch is the change. 0.5 is the unnormalised clear value the replay used, and 0.516129017 is what the format's normalisation should produce (132/255 ≈ 0.5176 for an 8-bit channel); the branch normalises the clear colour per format and main does not. A numeric difference with five decimals is the cleanest kind of control - there is nothing to interpret.

What I did not test: the other formats the header now normalises, and the GPU-side result (this is a replay-level CPU test).

Why I am commenting: I verify open pull requests that replay onto current main, build what their tests name, run them, then revert only the source change. 22 controls so far: 15 bite.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7275864033 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7275864033). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T10:37:52Z. --- Independent verification on this machine (Windows 11, MSVC 19.44.35226), with a negative control that bites on a numeric mismatch. **1. It applies.** `merge-tree` clean; the commits cherry-pick onto `main` `012b79a67` without a conflict. Two files: `runtime/src/vulkan_replay.h` and `runtime/test/clear_color_test.cpp`. **2. With the branch its test passes:** ``` ctest -R 'clear_color' 100% tests passed, 0 tests failed out of 1 ``` **3. The control - revert only the header, keep the test:** ``` git checkout origin/main -- runtime/src/vulkan_replay.h cmake --build … --target clear_color_test ctest -R 'clear_color' --output-on-failure 0% tests passed, 1 tests failed out of 1 normalised clear: format 4 rect 0 channel 0: got 0.5, expected 0.516129017 ``` **The mismatch is the change.** `0.5` is the **unnormalised** clear value the replay used, and `0.516129017` is what the format's normalisation should produce (`132/255 ≈ 0.5176` for an 8-bit channel); **the branch normalises the clear colour per format and `main` does not**. **A numeric difference with five decimals is the cleanest kind of control** - there is nothing to interpret. **What I did not test:** the other formats the header now normalises, and the GPU-side result (this is a replay-level CPU test). **Why I am commenting:** I verify open pull requests that replay onto current `main`, build what their tests name, run them, then revert **only** the source change. **22 controls so far: 15 bite.** Written with an AI assistant.
KelboLive commented 2026-11-30 17:45:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T17:45:33Z.


Independent check on Windows (not the author), at 1e0de21b0.

  • Built clear_color_test and ran it: 519 full/rectangle integer, normalised and float replay checks passed — exit 0.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711.

AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7286801857 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7286801857). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T17:45:33Z. --- Independent check on Windows (not the author), at `1e0de21b0`. - Built `clear_color_test` and ran it: **519 full/rectangle integer, normalised and float replay checks passed** — exit 0. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711. AI-assisted: yes (opencode).
aslan2142 commented 2026-12-01 16:43:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:43:22Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318103922 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2268#issuecomment-7318103922). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:43:22Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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
ProjectLeonida/mandy!2268
No description provided.