d3d12: LEONIDA_EXP_NO_PIXELS empties the scissors at each draw; what the pixels cost (D3D12-NO-PIXELS-PER-DRAW) #3164
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/3164:github-pr/3164" git switch "github-pr/3164"
Open
leonida/mandy
Lanworm wants to merge 6 commits from
github-pr/3164 into main
pull from: github-pr/3164
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!3164
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/3164"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This branch is out-of-date with the base branch
Reviewers 0 approvals
Details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as: D3D12-NO-PIXELS-PER-DRAW (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7350934809)
What and why
LEONIDA_EXP_NO_PIXELSis a diagnostics-only timing switch forLEONIDA_AB: it should leave the title's draws without pixels, so a phase's card time against the next one's is what the pixels cost. Until now it emptied the scissors insidedraw::scissors, i.e. only where a scissor was set. In the game it changed neither the picture nor the card's time, although new counters showed every scissor set in its phases being emptied, and a GPU test shows the driver honours an empty scissor.This PR:
draw.rs:State::no_pixelsempties the scissors right before each of the title's graphics draws (DrawInstanced, DrawIndexedInstanced, direct and amplified DispatchMesh, non-dispatch ExecuteIndirect), andState::pixels_backputs the title's back right after it, the wayLEONIDA_EXP_MESH_ONE_PIXELalready does for mesh draws. A draw before the title set any scissor in the list is left alone (it has none to take back).set_scissorsnow stores the rects and calls the newapply_scissors, whichmesh_scissoralso uses to restore; somesh_scissornow restores the widened rects underLEONIDA_SCISSOR_TEST=fulltoo (only when both experiments are set). With the switch off, and in non-diagnostics builds, every path sets the same scissors as before.ab.rs: the A/B counters line getsgraphics_drawsanddraws_without_pixels.tests/scissor.rs: a GPU test of the driver, not of the port: a full-target triangle under an empty, one-pixel and whole-target scissor, on the default adapter and WARP (0, 1 and 64 of 64 pixels). It shows the earlier no-effect result was not the driver.docs/findings.md: the measurement below.docs/switches.md: the two changed rows.The measurement (RTX 5060 Ti, i5-12400F, Series X as the F1 menu had saved it (the title's own upscaler from a render scale of 0.6667, no DLSS), no generated frames, standing,
LEONIDA_GPU_TIMING=1,LEONIDA_AB=4,LEONIDA_EXP_NO_PIXELS, 42 adjacent pairs of phases):draws_without_pixelsequalsgraphics_draws(about 4,900 a frame).The 14 ms is a difference rather than an exact share: it includes depth and blending, and anything the title derives from depth saw other input. Cheaper pixel shading can therefore take at most about a fifth off the card.
Tested
cargo test -p leonida-gpu --features diagnostics --locked: lib 777 passed,--test scissorpassed.cargo test -p leonida-gpu --locked --lib: 696 passed.cargo check -p leonida-gpu --locked, with and withoutdiagnostics.cargo clippy --all-targetsshows no new warnings in the changed code.python -I tests/test_d3d12_switches.pyandpython -m unittest discover -s tests -p "test_docs_*.py"pass.python -I scripts/check_no_game_data.pyon every changed file passes.python -I scripts/red_green.py nopixels-diagnosticsgivesverdict: no red(697 pass on both sides). This is expected: the only new test checks the driver, which is the same without the change. The change itself was confirmed in the game, by the counters above and by the card time and picture changing in ON phases, which they did not before.GPUs tested: NVIDIA GeForce RTX 5060 Ti, Windows 11 Pro 26200, plus WARP (the GPU test).
AI-assisted: yes. Claude Code with Claude Opus 5.5 wrote the code and the texts. The reviewer was also Claude Opus 5.5. The measurements were run in the game by the submitter.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Edited 2026-12-03: the run's profile corrected. The F1 menu had saved Series X before the run (the title's own upscaler from a render scale of 0.6667, no DLSS), not Series S with DLSS as first written; the numbers are unchanged.
Verified here: it applies on the current
mainand its integration test passes.The test is the right shape for the switch:
LEONIDA_EXP_NO_PIXELSempties each draw's scissor, and the test checks that a scissor leaves only its own pixels - which is what has to be true before the timing it produces means anything.What that does not say: the timings. The whole point of the switch is to measure what the pixels cost, and the number it produces has to come from a run of the title with and without it - this machine can measure neither, so I am not vouching for the finding it is meant to produce, only that the mechanism it rests on is tested.
For the merge: the checks show
BLOCKEDand the documentation files are in the change, sod3d12_switches.py --checkis worth a run before the review - it is the one check that catches a switch table that no longer matches the code.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Verification of #3164 (third party, code review on Linux; not built: Windows-only
leonida-gpu)1065952da5fb0f12c354d8782568132c22c836ed(5 files:ab.rs,draw.rs, newtests/scissor.rs,findings.md,switches.md; +326/-17).3c106eb2f.git merge-tree --write-tree origin/main pr/3164againstmain45dc41f95is clean(21 commits behind).
python -I scripts/check_no_game_data.pyon the 5 files (on the merge): exit 0.Review
mainemptied scissors only insidedraw::scissors, that is, only when the title set one. Draws thatran under scissors set earlier kept their pixels, so the A/B phase measured nothing. The fix empties the title's
scissors right before each graphics draw and puts them back right after (
State::no_pixels/pixels_back,draw.rs:5344-5372). It is applied at every title draw site: direct, mesh, indirect (kind != DISPATCH) andthe three other draw paths. This fixes the cause rather than adding another special case to
scissors().draw.rs:5391-5403) and the indirect site (:6905-6930). There is no?orreturnbetween the two calls, so a list never keeps empty scissors. The ordering withmesh_scissor(LEONIDA_EXP_MESH_ONE_PIXEL) is right: one-pixel scissor, emptied, title's scissors back,then
mesh_scissor(false).#[cfg(feature = "diagnostics")]. Release builds compileno_pixelstofalse, andpixels_back(.., false)is a branch. In diagnostics builds each draw does one relaxed atomic addand one
ab::pick.self.scissors.is_empty()). The newgraphics_draws/draws_without_pixelscounters in the A/B line show how much is missed. That is the rightinstrument, per AGENTS.md "check the instrument".
tests/scissor.rstests the driver, not the port. Its own header says it "cannot fail on the port's side", sothere is no red/green for the
draw.rschange. The counters and thefindings.mdrun are the evidence. Thatis acceptable for a diagnostics-only timing switch, and the body is honest about it.
Process
Windows at this head.
Verdict: ready (not built here). It only needs the fork CI approved.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Ran natively on Windows 11, head
1065952damerged into currentmain(b41763227, clean merge).MoonEyes read the code and fiestorra ran the scissor test, so here I only add what the thread doesn't have yet. That means the suite on the merge, a driver probe of what an empty scissor leaves besides pixels, the debug layer and the switches check.
Suite (measured)
cargo test -p leonida-gpu --features diagnostics, libtests/replay.rstests/scissor.rscargo test -p leonida-gpu --libwithout diagnosticscargo clippy -p leonida-gpu --all-targets, with / without diagnosticstests/scissor.rscopied ontomainpasses there too. That's expected because it tests the driver and not the port, so there's no red/green to get.python -I tools/d3d12_switches.py --check d3d12/docs/switches.mdpasses on the merge, which answers fiestorra's point.test_d3d12_switches.pypasses andcheck_no_game_data.pyon the 5 files exits 0.test_docs_python_depserrors here (f-string SyntaxError) onmainas well, so it isn't from this PR.What an empty scissor leaves (measured with a throwaway test, not pushed)
The test draws a full-target triangle into an 8x8 target through VS, GS, stream-out and PS, with depth and stencil writes on. VS, GS and PS each add to a root UAV, and occlusion, pipeline statistics and SO statistics queries wrap the draw.
DrawInstancedandExecuteIndirectwith a DRAW signature gave the same numbers. The card and WARP matched too, apart from the two cells marked WARP.I also ran a plain pipeline with no UAV, GS or stream-out, in case the driver skips vertex work once nothing can reach the rasterizer. It doesn't. VSInvocations is still 3 under the empty scissor on both adapters. So for VS/GS pipelines the PR's claim holds. Shading, depth, stencil, colour writes, PS UAV writes and occlusion counts all drop to zero, and everything before the rasterizer still runs. Mesh pipelines aren't covered because the probe only had FXC.
Debug layer (measured once, ID3D12InfoQueue present on both devices)
There are no errors. Each draw under an empty scissor gives one warning, ID 695, saying viewport 0 is non-empty while its scissor is empty.
Host::log_messagesdrains the queue at every submit and turns each message into atracing::warn. So withLEONIDA_D3D12_DEBUG=1and this switch on, the log would get up to one line per emptied draw, unless the info queue's own message limit caps it first. I didn't run the port under the debug layer, so that part is read. Muting ID 695 while the switch is inLEONIDA_ABwould be cheap, or one line in switches.md would do.Code (read)
On the title's runtime path, every host
DrawInstanced,DrawIndexedInstanced,DispatchMeshandExecuteIndirectis one of the five wrapped sites indraw.rs. The other hits are the port's own passes (compose, trainer overlay,record_plane_pass), the startup dispatch probeask_wide, tests and benches, and the capture player inreplay/play.rs. The title's list has noExecuteBundlehandler, so there's no bundle path to cover. All title scissors go throughset_scissors. Clears with rects ignore scissors in D3D12, so clears keep their cost in ON phases and aren't part of the 14 ms.MoonEyes checked the mesh and indirect sites for early exits. The other three (
DrawInstanced,DrawIndexedInstanced, amplified mesh) have nothing betweenno_pixelsandpixels_backeither. After a list cutreplay()sets the title's scissors again, and the next draw empties them again, so I don't see a way for the original scissors to leak back into an ON draw.With the switch off it reads the same as
main, except for the case the body already names.mesh_scissornow restores widened rects whenLEONIDA_SCISSOR_TEST=fulland mesh mode 2 are both set.LEONIDA_MESH_TEST=scissorworks withoutdiagnostics, so that one combination changes in normal builds too.The A/B counters fit the claim.
graphics_drawscounts calls, so anExecuteIndirectof N records counts once and the 4,900 a frame are calls, not records. ON phases also add twoRSSetScissorRectsper draw that OFF phases don't have, so the card-busy delta is if anything slightly low, and the frame median carries some extra submit-thread work.Conflicts (measured with
git merge-tree)Out of the 36 open PRs touching
draw.rs,ab.rs,findings.mdorswitches.md, only #2958 gets a new conflict from this one. It's indraw.rsat theDrawIndexedInstancedsite, on adjacent lines, and keeping both sides fixes it. The others that conflict already conflict withmainin the same files.Not checked: the in-game timings, mesh-shader pipelines under an empty scissor, a port-level test that each title draw really gets emptied or that switch-off is identical (both only read), the port itself under WARP or the debug layer (the probe made its own devices), a release build.
GPUs tested: an NVIDIA card (default adapter, hardware) and WARP (software adapter). The debug layer was confirmed on both for one probe run.
AI-assisted: yes (Claude Code).
RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head
1065952da5fb0f12c354d8782568132c22c836ed.git merge --no-ffontomainb41763227(diagnostics,dlss,mimalloc,exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit0; workspace test targets compiled).14PRs):#3200d1a91afd1,#319880a627bb1,#319193b47ac9d,#3189c182fc392,#3176ae0075d9a,#3168337388052,#31641065952da,#3146ebc0253ff,#312464600ef0c,#3069311d33a40,#30318df1bfce7,#3029e49404808,#3054ff53fd8b9,#3010d645712a3.610.88, Series X profile,2560x1440,-NoFrameGen,scripts/game-gate.ps1(301.3 sin world,LEONIDA_EXP_NO_PIXELSoff/default) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m,max_from_ctrl=5,053.9 m).c47eeb717f761d9d)mainb41763227baseline (cf499737bf684f6a)clean,0reasons,0warnings)clean,0reasons,0warnings)301.3 s(4,504frames)305.6 s0/0/00/0/020.10 FPS/69.76 ms19.13 FPS/74.01 ms8,048/5.222 s7,983/2.358 sVerdict: PASS for the 300 s default-off in-game stability gate on
1065952da. (We also plan a dedicatedLEONIDA_AB=10,LEONIDA_EXP_NO_PIXELSRTX 3090 measurement next.)(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)VERIFY-3164 — Windows nativo: la suite pasa, y el arreglo no tiene test porque el camino está tras un interruptor apagado
1065952da—draw.rs(two code lines + doc),tests/scissor.rs(comments)Ran at the head
The change, and it is a real bug:
pixels_offusedself.scissors.len().clamp(1, EMPTY.len())— so an empty scissor list became one empty scissor, i.e. it emptied a scissor that does not exist — and now it is.min(...)with a!self.scissors.is_empty()guard, so a draw before the title set any scissor is left alone.My control, which did not bite, and why: I put both lines back (
clamp(1, ...), no guard) and the suite stayed green. Because the whole path is insideif crate::ab::pick("LEONIDA_EXP_NO_PIXELS") == Some(true)— an experiment switch that is off unless someone sets it, and no test in the crate sets it.So, honestly:
red not constructiblefrom here. The fix is right by reading —clamp(1, ..)on an empty slice is exactly the "take back what was never set" bug — but the suite cannot fail on it, and a change that no test can reach is a change that a later edit can undo silently.And the second half of the commit is a test whose comments say more than most:
tests/scissor.rsis "a check of the driver, not of the port" — "a test of it cannot fail on the port's side". Writing that down is what keeps the test from being trusted for the wrong thing, which is a bigger service than the code line.What I could not test
LEONIDA_EXP_NO_PIXELSpath: it needs a D3D12 device and a title's scissor list.pixels_offwith the switch forced on (anab::pickseam), which would make this fix reachable by the suite.Written with an AI assistant.
Thanks to everyone who verified this.
e4dfc90answers the three points raised:State::no_pixelssets are now chosen by a small pure function,no_pixel_scissors(title, on)indraw.rs, covered byno_pixel_tests::no_pixels_empties_the_titles_scissors_only. It checks: as many empty scissors as the title set, at most 16; none when the title set none; none when the switch is off. I put the old choice back (on.then(|| &EMPTY[..title.clamp(1, 16)]), no guard) and the test fails:left: Some([RECT { 0, 0, 0, 0 }]),right: None. It passes with the change. This was done by reverting that one line by hand:red_green.pycannot build the new test againstmain, where the function does not exist.LEONIDA_EXP_NO_PIXELSis named inLEONIDA_AB, the host's info queue now gets a storage deny filter forD3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE(695). This is diagnostics builds only. It compiles and the suite passes; I have not run the port underLEONIDA_D3D12_DEBUG=1to see the log stay quiet.graphics_drawsdoc andfindings.mdnow say these are calls: an indirect execution of several records counts once.Tests on the head (RTX 5060 Ti, Windows 11):
cargo test -p leonida-gpu --features diagnostics --locked --lib: 778 passed.--test scissor: passed.test_d3d12_switches.pyandcheck_no_game_data.pyon the changed files: pass.@EdenBendheim, thanks for the gate run; an
LEONIDA_AB=10,LEONIDA_EXP_NO_PIXELSnumber from a 3090 would be a useful second point next to the 5060 Ti one.AI-assisted: yes (Claude Code, Claude Opus 5.5; reviewed by a separate Claude Opus 5.5 agent).
RUN (in game, one pull request), its head merged with
git merge --no-ffonto maind9b618f10: #3164e4dfc9012. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this pull request, on the head above. If it changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised.LEONIDA_EXP_NO_PIXELSis an experiment switch that is off by default and was left off, so this run covers the default path only. This run is at the low end of tonight's range on this machine (13.3 to 17.4 fps); one run cannot say whether that is the change or the scene.AI-assisted (Claude Code).
Rechecked
e4dfc901merged ontomaind9b618f1. The Windows MSVC diagnostics build under Wine 11.22 ran the draw suite with 28 passes and three existing ignores, includingno_pixels_empties_the_titles_scissors_only. A scratch control restored the original lower clamp insideno_pixel_scissorsand kept the new test. It failed on the zero-scissor case:Some([RECT { 0, 0, 0, 0 }])instead ofNone. The debug-layer filter compiled in the diagnostics build. The execution check here covered the scissor regression.I also paired this head with #3291
6b0ee46band the stricter catalog check from #3270. The combination merges cleanly and the tracked page passes all 21 catalog tests with 685 names and 646 descriptions. AI-assisted with OpenAI Codex.