Native iPhone port of Factorio 2.0.77
Run the original macOS ARM64 game code on iOS: - tools/retarget.py: header-only Mach-O retargeting to an iOS dylib - platform/native: UIKit host and macOS API shims (AppKit for SDL's Cocoa backend, CoreGraphics displays, CoreAudio device, Metal device properties, Wuffs PNG decoding, Steam and peripheral stubs) - touch, overlay, iOS keyboard and hardware keyboard input - tools/build_native.py: build, sign, install, data copy, launch - docs: build guide, controls, architecture Also includes the earlier static-translation research (ARM64 -> WASM -> native) under docs/research, runtime/, tests/ and tools/. No game files are included; the build reads them from a local install.
This commit is contained in:
commit
51d085e865
89 files changed
+7999
No files matched your search
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify initialization inputs against complete, source-bound REA byte records."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
from lift_rng import arm64_image,file_range
|
||||
from build_target_deserialiser import RANGES as TARGET_RANGES
|
||||
from build_deserialiser import RANGES as DESER_RANGES
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('binary',type=Path);parser.add_argument('bundle',type=Path)
|
||||
args=parser.parse_args();image,_=arm64_image(args.binary.read_bytes())
|
||||
source_hash=hashlib.sha256(image).hexdigest()
|
||||
bundle=json.loads(args.bundle.read_text())
|
||||
for name,ranges in [('target-deserialiser',TARGET_RANGES),('deserialiser',DESER_RANGES)]:
|
||||
checks=[]
|
||||
for address,size,expected in ranges:
|
||||
offset=file_range(image,address,size);data=image[offset:offset+size]
|
||||
assert hashlib.sha256(data).hexdigest()==expected
|
||||
matches=[]
|
||||
for record in bundle['records']:
|
||||
if record.get('operation')!='read_bytes' or record.get('confidence')!='observed' or record.get('authority')!='shipped-artifact':continue
|
||||
if record.get('subject',{}).get('digest',{}).get('sha256')!=source_hash:continue
|
||||
value=record['normalized_result']
|
||||
if value['address']==hex(address) and value['complete'] and value['returned_bytes']==size and value['requested_bytes']==size:
|
||||
if bytes.fromhex(value['bytes_hex'])!=data:raise ValueError('REA bytes contradict the pinned local input')
|
||||
matches.append(record['evidence_id'])
|
||||
if not matches:raise ValueError(f'Missing complete REA byte record at {address:#x} ({size} bytes)')
|
||||
checks.append({'address':hex(address),'bytes':size,'sha256':expected,'evidence_ids':matches})
|
||||
report={'status':'pass','arm64_sha256':source_hash,'checks':checks,
|
||||
'scope':'exact translation input bytes; not whole-engine behavioral equivalence'}
|
||||
(ROOT/'build'/name/'rea-provenance.json').write_text(json.dumps(report,indent=2)+'\n')
|
||||
print(f'PASS: {name}, {len(checks)} pinned input ranges match complete REA observations')
|
||||
Reference in new issue
Block a user