Viewport tags never expire; a freed resource can be passed to the RR runtime
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- computer-graphics
Direzione di ricerca
Start with store_tags in clean/rr_f/proxy/src/proxy_core.cpp (around lines 548-594), then lookup (around 811) and the evaluate path where describe_resource is called (around 1133). Also check free_resources (around 935) and the matching RrProbe code in probe.cpp. Done means the stage 1 erase rules are in place and a test in test_proxy_core using the fake runtime shows the stale hit-distance pointer never reaches describe_resource or evaluate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This was found by reading the code. It has not been reproduced.
What happens
RrProxy::store_tags (clean/rr_f/proxy/src/proxy_core.cpp:548-594) copies t.resource->native into the stored tag and t.lifetime into s.lifetime. It takes no reference. Only a lifetime-0 tag of a type the runtime reads gets a runtime-owned copy (proxy_core.cpp:574-591).
Entries in viewport_tags_ are removed only by replacement or an explicit null tag (proxy_core.cpp:554-560), by shutdown (proxy_core.cpp:374-375) and by the destructor (proxy_core.cpp:195). lookup falls back to viewport_tags_ with no lifetime or frame check (proxy_core.cpp:811-812). The stored lifetime is never consulted for expiry. new_frame_token only records the index (proxy_core.cpp:708). free_resources destroys the instance and the viewport only (proxy_core.cpp:935).
In the evaluate routing, optional inputs (specular motion, hit distance, disocclusion, guides, layer, opacity, alpha) are used purely because lookup succeeds. The stale pointer is then passed to describe_resource (proxy_core.cpp:1133) and on to the runtime evaluate.
The probe's own RrProbe has the same structure (probe.cpp:497-534).
When it can happen
Needs a game that tags an optional input in some frames and then stops tagging it without tagging null, and frees or recycles the resource. Or a game that frees the RR viewport and reuses its id with a different input set. A game that tags its full set every frame (the common case) or untags with null is not affected.
Plausible triggers: toggling an in-game option that removes an optional guide (depth of field, transparency layer, alpha), or a resolution change that reallocates targets while only the required set is tagged again.
Result: describe_resource or evaluate on a released ID3D12Resource (a crash), or reading an unrelated reallocated resource (garbage in the RR output). Medium severity: a crash is possible, but it needs an uncommon tagging pattern. Related: #63 (RR heaps released at destroy).
To do
Stage 1, now:
- In
free_resources, erase (andrelease_tag) everyviewport_tags_entry whose key's first element is the freed viewport id. - After an RR evaluate, successful or not, erase the
viewport_tags_entries withlifetime == WG_LIFE_UNTIL_EVALUATEfor that viewport.
Stage 2, later:
- Optionally stamp tags with a frame generation and expire lifetime-1 tags at the next frame token. Do this only with evidence from probe logs of real games that they re-tag every frame.
Cautions: a game that tags persistent targets once and relies on the original interface keeping them would lose inputs after the lifetime-1 change. That breaks the contract but may be tolerated by the original. Keep a transient copy alive until the GPU has finished; that is already the runtime's job via release_tag.
Test
CPU-only, in test_proxy_core with the fake runtime.
- Tag hit-distance (lifetime 2) plus the required set, evaluate. Next frame tag only the required set, evaluate. Assert the fake runtime's
describe_resourceand evaluate never saw the hit-distance pointer the second time. - Free the viewport, allocate the same id again. Assert no old tag reaches the runtime.
- Lingua principale
- C++
- Stelle
- 12
- Fork
- 2
- Merge medio
- 3h 10m
- PR unite (30g)
- 171
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di phantoslayer21/wronggpu
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#275 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
phantoslayer21/wronggpu#274 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#241 ·
I maintainer di solito rispondono entro 1 giorno
-
bug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
phantoslayer21/wronggpu#234 ·
I maintainer di solito rispondono entro 1 giorno
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildApertabug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
phantoslayer21/wronggpu#233 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di phantoslayer21/wronggpu
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Nheko-Reborn/nheko#2092 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
ROCm/rocm-libraries#16108 ·
I maintainer di solito rispondono entro 2 giorni