play-nvidia: an eight-byte qwMemorySize is decoded, not cast (D3D12-VRAM-BYTES) #3279
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3279"
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?
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T02:08:40Z.
Item: D3D12-VRAM-BYTES (claimed in #2570). Comes from @merzleckeier's review on #3272.
What changes
play-nvidia.ps1's$vramis the largestHardwareInformation.qwMemorySizeof the display class. The script cast that value straight to[uint64]. Some drivers write it as eight little-endian bytes (REG_BINARY): the cast then threw inside the walk's singletry, and the walk stopped at that adapter.Under the Series X 20 GB rule for frame generation with ray tracing, this gave the wrong answer twice. The launcher's
card_factsdecodes the bytes, so it said the opposite each time:The fix:
[BitConverter]::ToUInt64($q, 0).try, so an odd value skips that adapter only, not the rest of the walk.Tested
Windows 11, Windows PowerShell 5.1. Script only, no game run.
test_nvidia_frame_generation_with_ray_tracing: the registry stub now takes several adapters, each an integer or a byte array. Four new cases:python -m unittest discover -s tests -p test_win_launchers.py: 11 tests OK.tests/test_text_write_line_endings.pyOK;scripts/check_no_game_data.pyon both files OK.AI-assisted (oreofr-agent, Claude Code).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-12-03T02:11:31Z.
I reran the eleven synthetic VRAM budget cases from #2600 on main at
d15e048aand this PR atbeb14940. Both Windows PowerShell 5.1 and PowerShell 7 went from 6/11 to 9/11. Binary 4 GiB now correctly omits both memory budgets, and a short byte array no longer prevents a later valid adapter from being counted.Two cases still stop the scan before the sole usable 4 GiB reading. A terminating property-read error occurs outside the per-adapter try, and Get-ChildItem with ErrorAction Stop terminates on a nonterminating enumeration error. Both cases leave VRAM unknown and emit the 1,536 MiB card-buffer and 3,072 MiB window budgets.
In a disposable copy of this head, I moved Get-ItemProperty into the per-adapter try with ErrorAction Stop and used ErrorAction SilentlyContinue for the class enumeration. The existing decode and size policy stayed intact. All 11 cases passed in each shell. These were launcher dry runs with simulated registry entries and no game or GPU workload. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T02:16:37Z.
Review: COMMENTED
Verified
beb14940together with #3272 atdb005c43ond15e048a. The two launcher suites had 110 passes and seven skips with PowerShell 7.7.0 on Linux. For integer or eight-byte VRAM readings, the desktop Settings and the actual PowerShell dry run agree, including one byte below the Series X 20 GiB cutoff, the exact cutoff, and 8 GiB integer followed by 24 GiB binary.There is a separate parity gap for malformed values.
card_memory()accepts short byte arrays and rejects arrays longer than eight bytes and numeric strings. The new PowerShell branch reads the first eight bytes of a longer array, skips short arrays, and still casts numeric strings. For an 8 GiB reading encoded in five bytes the UI greys 2x and PLAY keeps it. For the same value in nine bytes or as a numeric string the UI enables 2x and PLAY drops it. The disagreement also showed up with a valid 8 GiB entry followed by a short or long 24 GiB entry. A disposable variant that treated only integral values and exactly eight binary bytes as VRAM made both paths agree in all eleven cases. The registry values were synthetic. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T02:20:59Z.
Thanks @merzleckeier and @ecox982745. Both are addressed in
7809f10bf.card_memorynow read only an integer (REG_QWORD/REG_DWORD) or exactly eight little-endian bytes. A shorter or longer array, or a string, is no size on both sides.Get-ItemPropertynow runs with-ErrorAction Stopinside the per-adaptertry, so a terminating read error skips that adapter;-ErrorAction SilentlyContinue, then walked with aforeach, so a listing error no longer ends the walk.Seven new dry-run cases:
card_memory's test also gains the 5-byte and 9-byte arrays.Results:
tests/test_win_launchers.py: 11 OK in Windows PowerShell 5.1.tests/test_leonida_launcher.py: OK.beb149402the 9-byte, string, 8 GB + 9-byte, throwing-adapter and listing-error cases fail.(oreofr-agent, AI-assisted)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T02:23:07Z.
Rechecked
7809f10bwith #3272 at6d9a22f5ond15e048a. Settings and PowerShell agreed in all eleven cases, including the five previously divergent ones. The launcher suites had 110 passes and seven skips with PowerShell 7.7.0 on Linux, including the new synthetic registry-error cases.Merge-order note: the two PRs now conflict only in
tests/test_leonida_launcher.py. Keeping #3272’s tests and adding #3279’s two short/long-array assertions resolves the conflict. The results above are from that locally resolved tree. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T02:26:36Z.
VERIFY-3279 — Windows nativo: la decodificación muerde, y es el caso que pedí
Corrí las dos suites que toca, en el head (
7809f10bf):Control (sintético): quité la decodificación — la línea
if ($q -is [byte[]]) { $q = … [BitConverter]::ToUInt64($q, 0) … }sustituida por un comentario — y volví a correr:Muerde, y muerde en la tabla de casos — el test compara un diccionario de perfiles contra lo que el dry run dice de cada uno, así que el control no rompe una aserción sino la tabla entera, que es lo que se quiere de un caso de representación.
Y es exactamente lo que merzleckeier describió en
#3272— "decoding the eight-byte value with[BitConverter]::ToUInt64($q, 0)before the cast made both cases agree" — con la diferencia de que aquí está en el script y probado, en vez de en una copia desechable. Las dos formas que él enumeró (sólo ocho bytes, y entero seguido de ocho bytes) están en la tabla, y el caso del adaptador que lanza al leer el registro ($global:listError,Write-Error 'Requested registry access is not allowed.') también, que es el que evita que un adaptador raro se lleve el recorrido entero.Lo que no probé: el registro de verdad — el test sustituye
Get-CimInstancey el registro por funciones de prueba, así que lo verificado es que el script decodifica lo que le dan y que la tabla de perfiles cuadra, no que un driver concreto escriba esos ocho bytes en esta máquina.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T02:43:12Z.
Merging (OreoFR's OK): head
7809f10bfon maind15e048a7, CI green on all six checks, the review findings of merzleckeier and ecox982745 addressed in7809f10bf. Sent to the merge queue. (oreofr-agent, AI-assisted)