"""Build bounded synthetic dynamic-size RR references with the standalone engine. Reference resets at each size change; combined NGX frames deliberately omit that reset to verify the adapter's implicit history reset. This is engine consistency, not an NVIDIA image-quality reference. No game files are read or written. """ import argparse import json import os from pathlib import Path import shutil import struct import subprocess import sys def main(): repo = Path(__file__).resolve().parents[2] parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--runner', required=True, type=lambda p: Path(p).resolve()) parser.add_argument('--model', required=True, type=lambda p: Path(p).resolve()) parser.add_argument('--output', required=True, type=lambda p: Path(p).resolve()) args = parser.parse_args() if args.output.exists() or not args.output.is_relative_to((repo / 'build').resolve()): parser.error('use a fresh directory under ignored build/') args.output.mkdir(parents=True) inputs, reference = args.output / 'inputs', args.output / 'reference' inputs.mkdir(); reference.mkdir() lines, extents = ['size 96 96 192 192'], [] env = {key: value for key, value in os.environ.items() if not key.startswith('D4R_')} env['D4R_RR_TIME_REPEAT'] = '1' index = 0 for segment, (width, height) in enumerate(((96, 96), (64, 64), (96, 96), (72, 80))): source, result = args.output / f'segment-{segment}', args.output / f'reference-{segment}' subprocess.run([sys.executable, str(repo / 'scripts/windows/rr-synthetic-inputs.py'), str(source), '--width', str(width), '--height', str(height), '--frames', '2', '--output-width', '192', '--output-height', '192'], check=True, timeout=60) # Exercise optional-view rebinding across reconfiguration and an absent # guide frame. Fixture uploads and standalone replay use the same values. for frame in (1,): for name, texel in (('hitdistance', struct.pack('