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.
This commit is contained in:
ayo committed 2026-10-16 12:53:26 -04:00
1 parent 3345fffcd3
commit 247fe1092d
60 files changed
+7168 -66

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
import math
from pathlib import Path
import random
import re
import struct
import sys
import unittest
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tools/windows'))
from llvm22_ir import compatible_ir, float_hex
class CompatibilityTests(unittest.TestCase):
def test_float_widening_preserves_finite_values(self):
rng = random.Random(22)
patterns = [rng.getrandbits(32) for _ in range(20000)]
patterns += [(sign << 31) | (exponent << 23) | mantissa
for sign in (0, 1) for exponent in range(255)
for mantissa in (0, 1, 0x3fffff, 0x400000, 0x7fffff)]
for bits in patterns:
value = struct.unpack('>f', bits.to_bytes(4, 'big'))[0]
if not math.isfinite(value):
continue
rendered = float_hex(re.match(r'(.*)', f'{bits:08X}'))
self.assertEqual(bytes.fromhex(rendered[2:]), struct.pack('>d', value))
def test_nan_payload_and_signaling_bit_preserved(self):
for source, expected in [('7F800001', '0x7FF0000020000000'),
('FFC00001', '0xFFF8000020000000')]:
self.assertEqual(float_hex(re.match(r'(.*)', source)), expected)
def test_decimal_half_and_float(self):
result = compatible_ir('%a = fcmp ult float %x, 8.507060e+37\n'
'%b = fmul half %h, 1.953130e-03\n')
self.assertIn('0x47D0000020000000', result)
self.assertIn('0xH1800', result)
def test_double_and_strings_not_rounded_to_float(self):
text = '%a = fmul double %x, 1.23456789012345e+00\n!0 = !{!"float 1.234567e+00"}\n'
self.assertEqual(compatible_ir(text), text)
def test_denormal_mode_and_conservative_promises(self):
result = compatible_ir('attributes #0 = { denormal_fpenv(dynamic) '
'nocreateundeforpoison memory(read, target_mem: none) }\n'
'%x = uitofp contract nneg i32 %v to double\n')
self.assertIn('"denormal-fp-math"="dynamic,dynamic"', result)
self.assertNotIn('nocreateundeforpoison', result)
self.assertNotIn('target_mem', result)
self.assertIn('uitofp nneg i32', result)
if __name__ == '__main__':
unittest.main()
+34
View File
@@ -0,0 +1,34 @@
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()