#!/usr/bin/env python3 """Execute whole closed580059508/059485 with scripted registry/log/assert. No kernel load, physical GPU access or NBSI fallback implementation is implied. """ import argparse, hashlib, itertools, json, struct, warnings from _binary_path import resolve_580_binary from pathlib import Path warnings.filterwarnings('ignore',category=UserWarning,module='unicorn') from elftools.elf.elffile import ELFFile from unicorn import Uc, UC_ARCH_X86, UC_MODE_64, UC_HOOK_CODE from unicorn.x86_const import * p=argparse.ArgumentParser();p.add_argument('--check',action='store_true');a=p.parse_args() R=Path(__file__).resolve().parents[1] P=resolve_580_binary() EXPECTED='5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b' assert hashlib.sha256(P.read_bytes()).hexdigest()==EXPECTED TEXT=0x10000000;GLOBAL=0x20000000;GPU=0x30000000;STACK=0x40000000;STOP=0x50000000;RODATA=0x60000000;DATA=GPU+0x1e08 NAMES=['_nv059508rm','_nv059485rm'] with P.open('rb') as f: e=ELFFile(f);symbols=list(e.get_section_by_name('.symtab').iter_symbols());d={s.name:s for s in symbols};text=bytearray(e.get_section_by_name('.text').data());ro=e.get_section_by_name('.rodata').data();ti=e.get_section_index('.text');ri=e.get_section_index('.rodata');spans=[(d[n]['st_value'],d[n]['st_size']) for n in NAMES] for rel in e.get_section_by_name('.rela.text').iter_relocations(): off=rel['r_offset'] if not any(x<=off>1)&1]));w32(DATA+4,0x1234);w32(DATA+8,0x5678);w32(DATA+0xc,0x20);w32(DATA+0x10,99);w64(DATA+0x18,GPU);w32(GPU+0x1e28,0xabcd);w32(DB,0x87) call('_nv059508rm',[DATA,GPU]);call('_nv059485rm',[GPU]) observed=list(u.mem_read(DATA,2))+[r32(DATA+4),r32(DATA+8),r32(DATA+0xc),r32(DATA+0x10),int(r64(DATA+0x18)==GPU),r32(GPU+0x1e28),r32(DB)] rows.append((v,reads,observed,trace)) assert keys_seen==set(KEYS) fixture='// Whole original059508/059485; scripted registry, logger and assertion.\n' fixture+='pub const CASES: &[Case] = &[\n' for v,inputs,expected,events in rows: fixture+=f' Case {{ variant: {v}, reads: '+str([list(x) for x in inputs])+', expected: '+str(expected)+', events: &'+str(events)+' },\n' fixture+='];\n' report={'passed':True,'cases':len(rows),'whole_original_functions':NAMES,'artifact_sha256':EXPECTED,'vectors_sha256':hashlib.sha256(fixture.encode()).hexdigest(),'keys_verified_from_original_relocations':KEYS,'rea_source_evidence':'reports/timer-timeout-provenance.json','scope':'Whole original059508/059485 instruction execution with scripted registry DWORD results, logger/assertion boundaries and optional assertion-side flag mutation. No actual registry/NBSI provider, hardware access or initialized GPU graph claim.'} for path,value in [(R/'src/nvidia/src/gpu/timeout/config/registry/vectors.rs',fixture),(R/'reports/timeout-registry-binary.json',json.dumps(report,indent=2)+'\n')]: if a.check:assert path.read_text()==value,str(path)+' differs' else:path.write_text(value) print(json.dumps(report,indent=2))