Repository navigation
Conversation
…ts (RT-RECT-LIST-CORNER) Select the right-angle corner in post-divide NDC (x/w, y/w) via the minimum signed edge dot product (law-of-cosines equivalent to opposite the longest side, without float32 squared-length tie-break loss on thin axis-aligned strips or pre-divide overflow/distortion when w is large or differs across vertices). Compute the fourth corner bit-exact whenever either non-corner vertex matches the corner (zero ULP drift on axis-aligned grid coordinates and constant/flat attributes) and extrapolate linearly in NDC and 1/w when w differs with positive 1/w4. Adds self-contained GPU regression test d3d12_rect_list_corner_test covering w != 1, large w = 1e20, differing w, 5000:1 thin strips, near-square, rotated 45-degree rectangles, bit-exact non-dyadic constant attributes, and degenerate triangles.
…m + idle upload trim - Port RT-BINDLESS-DIMENSION-LIMITS (ubiquitarianism/leonida#2406, GPL-3.0, author aslan2142): grow 2D, 2D-array, 3D, and 1D sampled bindless arrays alike to max_images (65,536, growing 2D-array/3D/1D together under device limits), add BindlessSet::image_refusal() + per-dimension refusal counters and richer full-array diagnostics in d3d12_vulkan_device.cpp, and add vk_bindless_dimensions_test. - Port RT-RECT-LIST-CORNER (ubiquitarianism/leonida#2478, GPL-3.0, author lixonik): post-divide NDC signed edge dot-product corner selection, bit-exact fourth-corner reconstruction with perspective 1/w extrapolation for differing w, v1-leading triangle emission, and d3d12_rect_list_corner_test. - Reclaim 640+ MiB of idle sub-arena VRAM on <=10.5 GiB GPUs in d3d12_vulkan_device.cpp: default gpu_devlocal_arena to 0 MiB when KHR/hybrid RT is inactive (!state_.info.ray_tracing, saving 384 MiB), and cap auto rebar_devlocal_arena at 128 MiB on <=10.5 GiB GPUs (saving 256+ MiB); explicit LEONIDA_DEVLOCAL_BUFFER_ARENA_MB / LEONIDA_DEVLOCAL_ARENA_MB still override. - Port RT-TITLE-UPLOAD-TRIM (ubiquitarianism/leonida#2463, GPL-3.0, author kawaii-shakal): add runtime/src/title_upload_trim.h and title_upload_trim_test, and wire non-blocking try_lock idle trimming (>4 MiB buffers after 2000 ms) into DeviceState's staging pool via LEONIDA_TITLE_UPLOAD_IDLE_MS / LEONIDA_TITLE_UPLOAD_KEEP_MB. Verified on RTX 3080 with LEONIDA_VK_VALIDATION=1 (10/10 CTests pass, 0 validation errors, 5/5 test_docs_* suites pass, 0 game-data violations).
|
Independent Linux/Wine + NVIDIA check at head
AI-assisted. |
|
Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked. Reading (marked):
Limits: one machine, one run for the PR, one run for each main witness. AI-assisted (Claude Code, Claude Opus 5.5) |
|
Review of head 4283e3f (read against main 43a9d56, which contains ec91d69). The game run is in my RUN above. I suggest splitting this PR into two: Ready to merge on its own: picking the corner in NDC with the dot product (I checked that it matches "longest side" through the law of cosines) and copying the vertices bit for bit. Both look sound to me. Needs a source or a separate PR:
Minor points:
AI-assisted (Claude Code, Claude Opus 5.5) |
…ry (RT-RECT-LIST-CORNER) Addresses review feedback on ProjectLeonida#2478: - Drop the unmeasured NDC + 1/w differing-w fourth-corner extrapolation and w4=1 fallback, keeping the documented clip-space other_a + other_b - corner rule (with bit-exact component selection) uniformly for Position and all attributes. - Restore the original range-based corners loop so rect_list_geometry.h merges cleanly with ProjectLeonida#1970. - Update d3d12_rect_list_corner_test cases and header comment to match.
|
@MoonEyes Thanks for the thorough review and testing! Addressed all four points in
Re-tested on RTX 5070 (Windows 11, driver 610.88, Vulkan 1.4.341,
AI-assisted (Antigravity, Gemini). |
Fixes the rectangle-list fourth-corner selection and reconstruction in
runtime/src/rect_list_geometry.hfor packageRT-RECT-LIST-CORNER(#2464 Part B; builds on @kevincommits's numerical analysis in #1608 (comment)).Root cause removed
rect_list_geometry()picked the corner opposite the longest edge using pre-divide clip-space squared lengthsdx^2 + dy^2. That failed on:dx^2 + dy^2 == dx^2in float32 breaks the tie-break and flips the rectangle);w(e.g.,w = 1e20, wheredx^2 + dy^2overflows to+Inf);wacross vertices (where pre-divide distances pick the wrong corner).Computing post-divide NDC
(x/w, y/w)and selecting the vertex with the minimum signed incident-edge dot product (equivalently maxdot(e_in, e_out), unordered>=soNaN/w == 0deterministically falls back tov1) is algebraically identical to opposite-the-longest-side by the law of cosines for all triangles (including rotated rectangles, near-square, obtuse/acute, and degenerate) while keeping exact0.0dot product at any axis-aligned right angle.(((v0 + v1) + v2) - corner) - cornerwith direct(other_a, other_b, corner)selection and per-component bit-equality checks (OpBitcast+OpIEqual), preserving axis-aligned coordinates and constant/flat attributes bit-exact (0 ULP drift) while keeping the documented clip-spaceother_a + other_b - cornerrule uniformly forPositionand all interpolants (docs/d3d12_vulkan.md).for (const Corners& c : corners)loop header intact (git merge-treewith runtime: preamble-only flat scan, safe type lookups, and portable CPU test for rect_list_geometry #1970 is conflict-free).Testing
main(ec91d695c):d3d12_rect_list_corner_testfails on 7 corner-rule cases (w=1e20 corner v2: 2080/4096 off plane;differing w=(1.875,1,1) corner v0&w=(1,1,1.875) corner v2: 2080/4096 missed each;thin strip 5000:1 corner v2&v1: 2048/4096 missed each;flat non-dyadic exact: 4096/4096 pixels drifted;differing w=(1.875,1,1) flat color: 2080/4096 missed).220aa322e):ctest -R "^(d3d12_rect_list_corner|indirect_topology_and_stats)$": 2/2 passed (d3d12_rect_list_corner_test: all 17 cases passed, 0.27 s).python -I tests/test_ctest_registration.py -v: 6/6 passed.python -I scripts/check_no_game_data.py ...andgit diff --check: clean.VK_LAYER_KHRONOS_validationnot installed locally;d3d12_rect_list_corner_testis self-contained withoutllvm-mcand skips with 77 whengeometryShaderor Vulkan is unavailable).AI-assisted (Antigravity, Gemini).