Repository navigation
Fix HexTile centerline cell selection - #1776
sanyamsingh001 wants to merge 2 commits into
Conversation
Evaluate the third cube coordinate symmetrically to retain the intended centerline tie. Keep the existing pixel oracle and tolerance. Scope the Mem fixture mutex unwrap allowance so the original strict CI can validate this base. Co-authored-by: Codex <codex@openai.com>
FredApps
left a comment
There was a problem hiding this comment.
- This mixes two unrelated changes: the HexTile shader fix and a clippy allowance in crates/script/src/tests_services.rs:14-15. Please split the allowance out, or say which clippy invocation fails on current main without it. Main's
tests_servicesis already#[cfg(test)]and clippy.toml allows unwrap in tests. - The shader change at crates/gpu/src/shaders/fx_pixel2.wgsl:652 has no test that fails before and passes after. The three existing
cchextilecases in crates/gpu/src/tests_fx_pixel2.rs:218-220 do not land on a centerline. Please add a case with a pixel on the tie (for example a centre/rotation where u is exactly 0) and show it failed on the old shader. - The CPU reference
hex_cell(crates/effects/src/stylize3.rs:349-366) still uses-cx - czin f64. After this change the GPU uses a different expression, so the two can pick different cells at a tie. Either change the CPU reference the same way, or explain why the GPU is now the one that is right and show the parity test still holds at the tie. - The "observed" wrong cell is not shown anywhere. Please give the input (radius, rotate, center, pixel) and the old and new cell indices.
- No hosted CI ran. The author's results are on an older base; main has moved.
|
I checked this against f3f24ef and the retained failure evidence. The Mem allowance is superseded there: all three lock().unwrap() sites now use PoisonError::into_inner. I am omitting the allowance from the current-main successor. It originally followed three unwrap_used errors at tests_services.rs:16,19,23 from Rust 1.99.1 running cargo clippy --workspace --all-targets --release -- -D warnings on 8f02f52. That source had a compound cfg(all(test, not(windows))) gate despite allow-unwrap-in-tests=true. This is historical evidence, not a claim that current main needs the allowance. The first existing radius-9.3 case already exercises the tie. The layer is 70×44 with input center (35,22); scale 0.5 gives a 35×22 pattern-7 buffer, effective radius 4.65 and center (17.5,11). Rotation and smearing are zero. Pixel x=17 is sampled at 17.5, so u is exactly zero. effect_case calls effect_direct(false), reaching this direct comparison before the composited cases. The old shader failed the unchanged comparison: “adj false scale 0.5: 2 of 770 pixels over 1e-3 (max 0.7781502)”, with worst pixel (17,2). After the one-file correction, the unchanged test passed: 1 passed, 0 failed, 0 ignored, 213 filtered, using: cargo test -p effectcraft-gpu --release --lib tests_fx_pixel2::stylize -- --exact --nocapture --test-threads=1 For that input at (17,2), source-arithmetic cell indices (rx,rz) are old f32 (0,-1), corrected (1,-1), and CPU f64 (1,-1). The old f32 evaluation makes ddx greater than ddy and adjusts rx. The symmetric expression preserves q==ccy at u=0; the existing f64 CPU expression already selects the same cell here. CPU code, inputs and tolerance were unchanged. This explains this case without claiming universal tie parity. Those indices are calculated inferences, not recorded GPU intermediates. The fixture/sample calculation exactly matches all four retained actual CPU/GPU channels at the worst pixel (17,2). The f3f24ef shader changes concern Wire Removal and do not incorporate this HexTile correction; the HexTile case and CPU reference are unchanged. Historical focused validation observed Vulkan llvmpipe with REQUIRE_GPU=1, and prior full CI remains local, exact-base evidence. I am preparing a shader-only successor preserving the upstream changes; its original full CI is still pending. No hosted or current-main CI result is claimed here. |
|
Thanks for the detailed write-up, @sanyamsingh001! It settles most of my review:
One point is still open: the CPU reference ( My change request stays in place until the successor without the |
Keep the existing regression and tolerance while preserving upstream WireRemoval and test-service recovery changes. Co-authored-by: Codex <codex@openai.com>
|
Tested on AMD hardware: RX 6900 XT, Windows 11, Adrenalin 32.0.21045.5002, This fixes the
Generated with Claude Code |
|
@FredApps, for the requested hosted validation, I checked the workflow definitions at main |
HexTile now computes its third cube coordinate symmetrically in both the CPU implementation and the WGSL shader. This avoids deriving it by subtracting separately computed coordinates with floating-point rounding, which can select a different cell at a centerline tie.
The existing stylize regression uses a 70×44 layer with center (35,22), radius 9.3, scale 0.5, and zero rotation and smear. Its effective 35×22 buffer has center (17.5,11) and radius 4.65. The retained shader-only comparison failed at the original tolerance before the correction and passed afterward; the recorded worst pixel was (17,2). Cell-index calculations explain that recorded color, but were not GPU tracing.
This f3f24ef-based successor changes only the CPU and shader expressions. It preserves upstream WireRemoval changes and test-service poison recovery; the historical Mem fixture lint allowance is no longer included. Inputs and tolerance remain unchanged, with no parameter sweep.
Original full repository CI passed on this exact two-file source: formatting, strict release Clippy, 3,671 native tests and 2 doctests passed, with 31 native tests ignored and no failures. The native total includes the 222-test GPU harness and the existing stylize regression. PDF backend policy, layering, 39 attributed assets, and compilation of 32 Wasm crates passed. The Wasm check retained the non-fatal pointer_wrap::State.disabled warning; Mesa diagnostics are preserved.
Validation ran on Linux with Mesa software-rendering settings and EFFECTCRAFT_REQUIRE_GPU=1. Passing harness counts do not prove every optional GPU, FFmpeg or parser branch executed. These results qualify the f3f24ef-based successor, not later main revisions, other hardware/backends/platforms, or browser/Wasm runtime behavior.
AI-generated with Codex; implementation and review used GPT-6.1 Sol and GPT-6 Astra agents.
Summary by CodeRabbit