ScarletNX / ScarletNX documentation / NVN reference · ← previous · next →
Techniques and pitfalls
Techniques that worked:
- Verify a replaced function against the original. Run the SDK function on a copy of the CPU state and compare
every register with the replacement's result.
- Byte-compare a GPFIFO entry with command memory to find which list or pool it came from. Translate GPU addresses
to CPU addresses before concluding two ranges are separate, since they live in different address spaces.
- Read back at the operation, not at the present. A readback at the present describes the frame's last use of an
address, not the operation in question.
- Prove coverage with a sentinel. Clear to an unusual value per component, draw, and accept a target as fully
written only if every component of every pixel changed.
- Trace the executed MME to learn a macro's arguments, rather than guessing from the call site.
gpu_trace_target narrows a wrong target to the clears and draws that wrote it.
Pitfalls:
- Screenshot hashes are not deterministic across unmodified fixed-frame runs. Compare readbacks of a chosen target.
- Post-submit comparisons mislead. Surfaces are reused at the same address within a submission (game B clears and
reuses one depth surface for each cube face), so a later readback describes a different operation.
- Two uncovered images both read back as zero and compare equal. Check coverage before calling a comparison a match.
- A probe that submits or finishes the queue changes what it measures. A readback after a draw once masked a missing
descriptor, and a queue finish advanced the frame so that draws were skipped and the result looked better.
- Bounded logs answer "maybe" when they wrap. The old Maxwell write log (1,024 entries) answered "assume dirty" for
any range over 1 MiB once constant buffer updates wrapped it, every frame, and the probes treated that as a real
write. Writes are kept per page now (
gpu/maxwell/write_pages.c), but a write of the same data still
counts as a write.
- A zero texture handle (game D binds many) may be an unused slot or a shader-visible null descriptor. Decide from
the shader's texture use, not from the bind.
- Run counts vary with timing even at the same frame limit. Treat them as samples, not coverage.
← previous · next →