Match Jimmy controller arithmetic and facing to original probes
This commit is contained in:
1 parent
42ea2b8cd5
commit
0e2f426d42
60 files changed
+6027
-48
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""Jimmy facing source/constant identity and copied-original observation provenance."""
|
||||
from pathlib import Path
|
||||
import hashlib,json,sys,unittest
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0,str(ROOT/'tools/binary'))
|
||||
from jimmy_orientation import collect
|
||||
class JimmyOrientationEvidence(unittest.TestCase):
|
||||
def test_identity_ranges_offsets_and_double_factors(self):
|
||||
source=collect(ROOT.parent/'Original');fixture=json.loads((ROOT/'tests/GamePort.JimmyOrientationTests/original-orientation-reference.json').read_text())
|
||||
for field in ('source_sha256','ranges','constants'):self.assertEqual(source[field],fixture[field])
|
||||
self.assertEqual(source['constants'],{'0x4afcf0':3.7,'0x4afd38':4.5})
|
||||
for row in source['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
|
||||
def test_native_provenance_case_completeness_and_gates(self):
|
||||
fixture=json.loads((ROOT/'tests/GamePort.JimmyOrientationTests/original-orientation-reference.json').read_text())
|
||||
self.assertEqual(len(fixture['cases']),16)
|
||||
for file,digest in fixture['files'].items():
|
||||
self.assertEqual(len(digest),64)
|
||||
if file.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
|
||||
cases={c['name']:c for c in fixture['cases']}
|
||||
for name in ('clean','disabled','zero_dt'):self.assertEqual(cases[name]['observed'][:3],cases[name]['input'][:3])
|
||||
self.assertGreater(cases['level']['observed'][0],338)
|
||||
self.assertGreater(cases['positive180']['observed'][1],0)
|
||||
if __name__=='__main__':unittest.main()
|
||||
Reference in new issue
Block a user