runtime: write watching on by default under Wine too (RT-WRITE-WATCH-WINE-DEFAULT) #2572
Closed
leonida/mandy
goof787lord wants to merge 0 commits from
rt-write-watch-wine-default into main
pull from: rt-write-watch-wine-default
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/3164
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!2572
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-write-watch-wine-default"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239480247 (
RT-WRITE-WATCH-WINE-DEFAULT)What
leonida::title_write_watch::enabled()(runtime/src/title_page_watch.h) turnedMEM_WRITE_WATCHoff whenever ntdll exportswine_get_version, with the note that Wine's write watching "was not measured here". Without it every shadowed page of title memory keeps its read-only guard and is copied again after the title's first write faults. This makes write watching the default under Wine as on Windows;LEONIDA_WRITE_WATCH=0still selects the guards. The comment anddocs/d3d12_vulkan.md(shadow refresh, "Which pages changed") say so.Measured
Linux, Proton Experimental (Wine 11), RTX 5070 Ti 16 GB, NVIDIA 620.73, Ryzen 7 7800X3D, 30 GB RAM;
gta6rt --runon the Vulkan backend with the settings ofdocs/running.md("Linux, Proton, NVIDIA") plus the hang-watchdog kick, the same warm pipeline journal for both runs. Numbers from the runtime's ownsubmit phasesline:LEONIDA_WRITE_WATCHunset (guards)LEONIDA_WRITE_WATCH=1The world itself was not measured yet in either mode.
Tests
title_write_watch_testunder the same Wine: OK (18 checks, 0 failures).xmem_testunder the same Wine has one failure withLEONIDA_WRITE_WATCH=0and with=1alike ("writing to 512 of them charges about those 512 pages"; 450 and 470 checks), so it is not from this change.No game data in this pull request.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Tested the default flip on Linux with GE-Proton11-14 (Wine 11.0 Staging), physical gfx906, RADV Mesa 26.0.8. Main
1bc055e6candb10f8c045merged with it used identical synthetic fixtures and fresh processes. WithLEONIDA_WRITE_WATCHunset, the same ordinary shim allocation went from guarded on main to write-watched on the merge. Explicit=0stayed guarded and=1stayed watched on both. Dirty-page query, reset and rewrite matched the selected mode.OpenExistingHeapFromAddressreturnedS_OKfor an untouched, committed 64 KiB shim allocation in 6/6 cases, including all three watched cases. A separate slot-133 buffer on that allocation used the shadow fallback, not imported GPU memory; its fenced readback matched 16,384/16,384 words in every case. No synchronization hazards or host validation errors in the six GPU runs.Both builds used the same local
win32ufix that preserves the external host-allocation handle type. This supports the default change on that Wine 11 stack; it does not settle the Wine 9 software-write-watch concern or establish a throughput improvement.AI-assisted.
Tested
b10f8c045merged (no commit) withmainc8bf0e7b6. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo.check_no_game_data.pyis clean.enabled()intitle_page_watch.his already true here before and after the change (only thewine_get_versioncheck goes away), andtitle_write_watch_testgives the same result on both.xbox_presentfails, as on plainmainhere.gta6rt.exelinked withoutws2_32.libgivesmain's 26 unresolved Rust-std symbols, nothing new. Its imports are identical tomain's.E_OUTOFMEMORY, so the guarded default should stay there. It has no author reply yet.runtime/CMakeLists.txt:1706,:2989, andruntime/test/d3d12_title_va_test.cpp:730.AI-assisted (Claude Code).
Verified on the C++ runtime here: it applies, the runtime builds with it, and the test that covers this header passes.
Applied onto
origin/main4364a4fa6(branch is 1205 commits behind, so this is the question worth answering):So the header change compiles into the whole runtime and does not disturb what
runtime/test/title_write_watch_test.cppchecks about reservations,for_each_in,containsandremove.What I could not verify, and this is the part the change is actually about: the default's effect under Wine. The measurement in the new doc paragraph is the
author's (Proton Experimental, Wine 11, RTX 5070 Ti, the shadow refresh down from about 109 ms to 2-7 ms a submission), and this machine runs Windows with no Wine
in the loop, so the only thing I can say is that the code still builds and the platform-independent behaviour is unchanged. Someone with a Wine setup has to confirm
the default is the right one - which is exactly the kind of claim that should not be taken from a build passing.
Written with an AI assistant.
Verified as far as this machine allows, which is less far than it looks: the test passes with and without the change, and the reason is the environment, not the code.
1. It applies.
merge-treeclean;b10f8c045cherry-picks ontomain1d22590b9without a conflict. Two files,10 insertions(+), 8 deletions(-):docs/d3d12_vulkan.mdandruntime/src/title_page_watch.h.The change is one function returning
truewhere it used to askntdll.dllforwine_get_version:2. It builds, and the test passes three times:
title_write_watch_test.exe-> exit 0, 0, 0.3. The negative control does not distinguish the two versions, and I want to be precise about why. With
runtime/src/title_page_watch.hreverted tomain, the binary is genuinely rebuilt (timestamp 06:38:19 -> 06:38:29,[2/2] Linking) and reports:The file does not mention Wine at all -
Select-Stringforwine/Wine/enabled(finds nothing in it - so the behaviour this commit changes is the Wine default, and this machine is native Windows where both versions returntrue. The 18 checks exercise the shadow and page bookkeeping, not the platform predicate.So the honest verdict: it applies, it does not regress, and the one thing it changes cannot be tested on the machine that would have to run the test. The evidence in the PR - Proton Experimental (Wine 11) on an RTX 5070 Ti, load from about 0.2 to 30 frames a second and the shadow refresh from about 109 ms to 2-7 ms - is the measurement that matters, and it is someone else's, on the platform the change is for.
What a reviewer should ask for: a run of
title_write_watch_testunder Wine, whereenabled()differs between the two versions. On Windows it is the same value by design, which is exactly why this file cannot catch a regression in it.Written with an AI assistant.
Compared the real shim reservation paths on Wine 11.22 with
b10f8c045+ed867d7b2. I ran the same reservation and re-reservation checks in freshxmem_testprocesses with the switch unset,0and1. With it unset, main used 107 non-watch assertions and the PR used 127 assertions, including a successfulGetWriteWatchon ordinary reserved and committed memory. Explicit0gave 107 passing checks and explicit1gave 127 on both trees. The two-reader journal suite passed 18/18 on both. The full XMem suite also exposed the same 512-page working-set assertion failure on both builds in each switch state. Synthetic allocations only.AI-assisted with OpenAI Codex.
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.