Files
d4r/tests/windows/test_rr_deploy.py
T
ayo 247fe1092d Advance native Windows RR integration, kernel tooling and local packaging
Implement native NGX feature-13 RR through a LUID-matched D3D12/Vulkan
shared-memory and timeline-fence bridge. Add owned parameter snapshots,
GPU resource lifetime handling, inherited/enhanced barriers, optional
guides, sampled input formats and depth-plane support with stencil
preservation. Separate RR initialization from the SR CUDA runtime and
expose explicit backend/model selection through player configuration.

Add synthetic bridge, snapshot and NGX lifecycle harnesses covering
camera/history/reset, parameter mutation, delayed submission, early
release, capability gating and unsupported-input rejection.

Add exact gfx11 D/E model generation, verified caches, versioned local
deployment with configuration backups, and isolated portable model
tools with pinned Python, NumPy and glslang dependencies.

Extend Windows K benchmarking and private native-cache selection.
Fix LLVM 22 emitter/helper compatibility and preserve exact-output
validation for local output-kernel optimization.

Add native FSR RR provider diagnostics, local development package
refresh tooling, installer/checker updates, FidelityFX headers and
Windows parity documentation.

Keep NVIDIA binaries, derived models and private optimized kernels out
of distributable packages. Native RR evidence remains synthetic;
game validation, FSR RR dispatch, installer integration and Linux
performance parity remain incomplete.
2026-10-16 12:53:26 -04:00

35 lines
1.7 KiB
Python

import sys
from pathlib import Path
import unittest
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tools/windows'))
from deploy_rr_model import select_native
class ConfigSelectionTests(unittest.TestCase):
def test_comments_bom_and_crlf_survive(self):
source = b'\xef\xbb\xbf[DLSS]\r\nModel = K ; keep SR\r\n[RayReconstruction]\r\nBackend = off ; keep comment\r\nModelDir = auto # keep path note\r\n'
result = select_native(source, 'engine/rr-d-test')
self.assertEqual(result, source.replace(b'Backend = off', b'Backend = native').replace(b'ModelDir = auto', b'ModelDir = engine/rr-d-test'))
self.assertEqual(select_native(result, 'engine/rr-d-test'), result)
def test_missing_section_preserves_other_settings(self):
source = b'[DLSS]\nModel=M\n; custom note'
result = select_native(source, 'engine/rr-e-test')
self.assertTrue(result.startswith(source))
self.assertIn(b'[RayReconstruction]\nBackend = native\nModelDir = engine/rr-e-test\n', result)
self.assertEqual(select_native(result, 'engine/rr-e-test'), result)
def test_duplicate_sections_cannot_restore_old_selection(self):
source = b'[RayReconstruction]\nBackend=off\n[Other]\nKeep=yes\n[rayreconstruction]\nModelDir=old-model\n'
result = select_native(source, 'engine/rr-d-test')
self.assertNotIn(b'old-model', result)
self.assertNotIn(b'Backend=off', result)
self.assertEqual(result.count(b'engine/rr-d-test'), 2)
self.assertIn(b'[Other]\nKeep=yes\n', result)
self.assertEqual(select_native(result, 'engine/rr-d-test'), result)
if __name__ == '__main__':
unittest.main()