nmarshall commited on
Commit
aee92ff
·
1 Parent(s): 5f7b2df

qvm: recover ranked tie predicate

Browse files
docs/FINDINGS.md CHANGED
@@ -1499,3 +1499,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1499
 
1500
 
1501
  **RE-833:** Rust now composes the full recovered7805 priority and matches438 continuous source cases, including pending clears and mode9 reset/event intentions. [Evidence](research/RUST_EXIT_COMPLETE.md).
 
 
 
 
1499
 
1500
 
1501
  **RE-833:** Rust now composes the full recovered7805 priority and matches438 continuous source cases, including pending clears and mode9 reset/event intentions. [Evidence](research/RUST_EXIT_COMPLETE.md).
1502
+
1503
+
1504
+ **RE-834:** Actual 7662 and child 33715 execute across 168 cases. Playing count and the enabled global gate ties; team-classified modes compare global scores, mode9 uses ranked field308, mode11 field696, and other modes field248. Raw numeric names remain conservative; ranked pointer legality and native execution remain open. [Evidence](research/QVM_EXIT_PREDICATE.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1515,3 +1515,6 @@ RE-833: Rust now composes the full recovered7805 priority and matches438 continu
1515
 
1516
 
1517
  - [ ] RE-834: Recover supplied exit predicate/transition/native effects, compose ranking→exit→scoreboard state, and validate actual runtime traces and macOS/Linux rendering. [Batch scope](research/QVM_FLOAT_EXIT_RULES_BATCH.md).
 
 
 
 
1515
 
1516
 
1517
  - [ ] RE-834: Recover supplied exit predicate/transition/native effects, compose ranking→exit→scoreboard state, and validate actual runtime traces and macOS/Linux rendering. [Batch scope](research/QVM_FLOAT_EXIT_RULES_BATCH.md).
1518
+
1519
+
1520
+ RE-834: Actual 7662 and child 33715 execute across 168 cases. Playing count and the enabled global gate ties; team-classified modes compare global scores, mode9 uses ranked field308, mode11 field696, and other modes field248. Raw numeric names remain conservative; ranked pointer legality and native execution remain open. Full runtime completion remains open. [Evidence](research/QVM_EXIT_PREDICATE.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -1839,3 +1839,8 @@ Rust now composes the full recovered7805 priority and matches438 continuous sour
1839
  RE-833 final review: added five explicit source-to-Rust dependency edges and registry regression assertions; the targeted registry test and repeated `rust-exit-complete` focused group pass. Added the ten-task batch summary and RE-834 follow-up scope.
1840
 
1841
  Batch RE-824–833 boundary: the single `cargo xtask test-full --since 1ed43d40` run passed after task ten: 1,628 Python tests, 127 Rust tests (assets 10, gameplay 89, xtask 28), 43 deterministic report producers, storage policy, 392 documentation files and whitespace checks. No generated report drift; validation notes amended into task ten.
 
 
 
 
 
 
1839
  RE-833 final review: added five explicit source-to-Rust dependency edges and registry regression assertions; the targeted registry test and repeated `rust-exit-complete` focused group pass. Added the ten-task batch summary and RE-834 follow-up scope.
1840
 
1841
  Batch RE-824–833 boundary: the single `cargo xtask test-full --since 1ed43d40` run passed after task ten: 1,628 Python tests, 127 Rust tests (assets 10, gameplay 89, xtask 28), 43 deterministic report producers, storage policy, 392 documentation files and whitespace checks. No generated report drift; validation notes amended into task ten.
1842
+
1843
+
1844
+ ## 2026-10-27 — RE-834 Original exit tie predicate and mode classifier
1845
+
1846
+ Actual 7662 and child 33715 execute across 168 cases. Playing count and the enabled global gate ties; team-classified modes compare global scores, mode9 uses ranked field308, mode11 field696, and other modes field248. Raw numeric names remain conservative; ranked pointer legality and native execution remain open. Focused `cargo xtask test-group exit-predicate` passes (5 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -1552,3 +1552,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1552
 
1553
 
1554
  - [ ] RE-834: Recover supplied exit predicate/transition/native effects, compose ranking→exit→scoreboard state, and validate actual runtime traces and macOS/Linux rendering. [Batch scope](research/QVM_FLOAT_EXIT_RULES_BATCH.md).
 
 
 
 
1552
 
1553
 
1554
  - [ ] RE-834: Recover supplied exit predicate/transition/native effects, compose ranking→exit→scoreboard state, and validate actual runtime traces and macOS/Linux rendering. [Batch scope](research/QVM_FLOAT_EXIT_RULES_BATCH.md).
1555
+
1556
+
1557
+ - [x] RE-834 Original exit tie predicate and mode classifier ([evidence](research/QVM_EXIT_PREDICATE.md)).
docs/research/QVM_EXIT_PREDICATE.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original exit tie predicate and mode classifier
2
+
3
+ RE-834. Reproduce with `python3 scripts/analyze_qvm_exit_predicate.py`; focused validation: `cargo xtask test-group exit-predicate`. [Machine report](qvm-exit-predicate.json).
4
+
5
+ Actual 7662 and child 33715 execute across 168 cases. Playing count and the enabled global gate ties; team-classified modes compare global scores, mode9 uses ranked field308, mode11 field696, and other modes field248. Raw numeric names remain conservative; ranked pointer legality and native execution remain open.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1091,3 +1091,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1091
  [RE-833: Rust complete recovered exit-rule decision and mutation composition](RUST_EXIT_COMPLETE.md).
1092
 
1093
  - [RE-824–833 float formatter and exit-rule batch](QVM_FLOAT_EXIT_RULES_BATCH.md).
 
 
 
 
1091
  [RE-833: Rust complete recovered exit-rule decision and mutation composition](RUST_EXIT_COMPLETE.md).
1092
 
1093
  - [RE-824–833 float formatter and exit-rule batch](QVM_FLOAT_EXIT_RULES_BATCH.md).
1094
+
1095
+
1096
+ [RE-834: Original exit tie predicate and mode classifier](QVM_EXIT_PREDICATE.md).
docs/research/qvm-exit-predicate.json ADDED
The diff for this file is too large to render. See raw diff
 
docs/research/qvm-resumer-audit.json CHANGED
@@ -8830,6 +8830,31 @@
8830
  "repeated_calls_opt_in": false,
8831
  "repeated_calls_setting": "default_false"
8832
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8833
  {
8834
  "backward_conditional_branches": [
8835
  285126,
@@ -9989,10 +10014,10 @@
9989
  }
9990
  },
9991
  "summary": {
9992
- "call_expressions": 199,
9993
- "files": 152,
9994
  "legacy_expressions": 158,
9995
- "nonliteral_ranges": 25,
9996
  "unresolved_mode_expressions": 3
9997
  }
9998
  }
 
8830
  "repeated_calls_opt_in": false,
8831
  "repeated_calls_setting": "default_false"
8832
  },
8833
+ {
8834
+ "backward_conditional_branches": [],
8835
+ "calls": [],
8836
+ "explicit_result_offsets": null,
8837
+ "helper": "qvm_trace_support.resume",
8838
+ "line": 18,
8839
+ "literal_range": [
8840
+ 33716,
8841
+ 33740
8842
+ ],
8843
+ "path": "scripts/qvm_intermission_support.py",
8844
+ "repeated_calls_opt_in": true,
8845
+ "repeated_calls_setting": "literal_true"
8846
+ },
8847
+ {
8848
+ "backward_conditional_branches": [],
8849
+ "calls": [],
8850
+ "explicit_result_offsets": null,
8851
+ "helper": "qvm_trace_support.resume",
8852
+ "line": 25,
8853
+ "literal_range": null,
8854
+ "path": "scripts/qvm_intermission_support.py",
8855
+ "repeated_calls_opt_in": true,
8856
+ "repeated_calls_setting": "literal_true"
8857
+ },
8858
  {
8859
  "backward_conditional_branches": [
8860
  285126,
 
10014
  }
10015
  },
10016
  "summary": {
10017
+ "call_expressions": 201,
10018
+ "files": 153,
10019
  "legacy_expressions": 158,
10020
+ "nonliteral_ranges": 26,
10021
  "unresolved_mode_expressions": 3
10022
  }
10023
  }
scripts/analyze_qvm_exit_predicate.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import itertools
3
+ from pathlib import Path
4
+ from qvm_research_support import source
5
+ from qvm_intermission_support import seed,execute
6
+ from analyze_qvm import write_json
7
+
8
+ def cases():
9
+ for playing,enabled,mode,pair,order in itertools.product([1,2],[0,1],[-1,0,3,8,9,11,12],[(0,0),(1,2),(-1,-1)],[[0,1],[1,0]]):
10
+ clients=[{'248':pair[0],'308':pair[1],'696':7},{'248':pair[1],'308':pair[0],'696':7 if pair[0]==pair[1] else 8}]
11
+ yield dict(playing=playing,enabled=enabled,mode=mode,first_score=pair[0],second_score=pair[1],order=order),clients
12
+
13
+ def main():
14
+ q,raw,h,ins=source();rows=[]
15
+ for a,c in cases():
16
+ m,p=execute(ins,seed(c,**a),7662,7805,28);rows.append({'input':a,'clients':c,**p})
17
+ write_json(Path('docs/research/qvm-exit-predicate.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual7662 with actual33715 mode classifier, signed gates and ranked-client field selection.168 finite fixtures. Original native runtime and raw invalid rank pointers remain unverified.'})
18
+ if __name__=='__main__':main()
scripts/qvm_intermission_support.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Original predicate and intermission helpers; external children remain captured."""
2
+ from qvm_exit_rules_support import seed as exit_seed,E,CPOOL,POOL
3
+ from qvm_trace_support import resume,captured
4
+ EXTRA=[452,4036,4324,6156]
5
+
6
+ def seed(clients=(),**a):
7
+ m=exit_seed(clients,**a)
8
+ m.update({98884:a.get('enabled',1),34992592:a.get('first',0),34992596:a.get('second',1),34999604:a.get('waiting',0),34999608:a.get('wait_start',0),34992580:a.get('rank_count',len(clients))})
9
+ for j,c in enumerate(clients):
10
+ for o in EXTRA:m[CPOOL+6336*j+o]=c.get(str(o),0)
11
+ m[POOL+880*j+424]=c.get('entity_flags',0)
12
+ m[POOL+880*j+520]=CPOOL+6336*j
13
+ m[34992592+4*j]=a.get('order',list(range(len(clients))))[j]
14
+ return m
15
+
16
+ def classify(ins,m,a):
17
+ m[E+0x1000+20]=a[8]
18
+ m,e=resume(ins,33716,33740,m,E+0x1000,repeated_calls=True,sync_child_words=True)
19
+ return m,e['return'],{'source_child':33715,'return':e['return']}
20
+
21
+ def execute(ins,m,start,stop,frame,args=None,targets=(),handlers=None):
22
+ for o,v in (args or {}).items():m[E+frame+o]=v
23
+ initial=dict(m);requests=[]
24
+ hs={t:captured(t,requests) for t in targets};hs[33715]=classify;hs.update(handlers or {})
25
+ m,e=resume(ins,start+1,stop,m,E,handlers=hs,repeated_calls=True,sync_child_words=True,segment_limit=4096,limit=32768)
26
+ changes=[{'address':a,'before':v&0xffffffff,'after':m[a]&0xffffffff} for a,v in initial.items() if m[a]!=v and not E<=a<E+0x2000]
27
+ return m,{'return':e['return'],'requests':requests,'changes':changes,'execution':{k:e[k] for k in ['stop','trace_length','trace_sha256']}}
28
+
29
+ def predicate(ins,m,args=None):
30
+ out,p=execute(ins,m,7662,7805,28)
31
+ return out,p['return'],p
scripts/test_qvm_exit_predicate.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+
4
+ def expected(a,c):
5
+ if a['playing']<2 or not a['enabled']:return 0
6
+ mode=a['mode']
7
+ if mode>=3 and mode not in [9,11]:return int(a['first_score']==a['second_score'])
8
+ key='308' if mode==9 else '696' if mode==11 else '248'
9
+ return int(c[a['order'][0]][key]==c[a['order'][1]][key])
10
+ class PredicateTests(unittest.TestCase):
11
+ def test_source_result_against_independent_policy(self):
12
+ r=json.loads(Path('docs/research/qvm-exit-predicate.json').read_text());self.assertEqual(len(r['probes']),168)
13
+ for p in r['probes']:self.assertEqual(p['return'],expected(p['input'],p['clients']))
14
+ def test_no_external_writes_or_captured_effects(self):
15
+ for p in json.loads(Path('docs/research/qvm-exit-predicate.json').read_text())['probes']:self.assertEqual(p['changes'],[]);self.assertEqual(p['requests'],[])
16
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -2154,3 +2154,8 @@ edge docs/research/qvm-exit-class.json scripts/analyze_rust_exit_class.py
2154
  edge docs/research/qvm-exit-limits.json scripts/analyze_rust_exit_limits.py
2155
  edge docs/research/qvm-exit-timers.json scripts/analyze_rust_exit_timers.py
2156
  edge docs/research/qvm-exit-complete.json scripts/analyze_rust_exit_complete.py
 
 
 
 
 
 
2154
  edge docs/research/qvm-exit-limits.json scripts/analyze_rust_exit_limits.py
2155
  edge docs/research/qvm-exit-timers.json scripts/analyze_rust_exit_timers.py
2156
  edge docs/research/qvm-exit-complete.json scripts/analyze_rust_exit_complete.py
2157
+ report scripts/analyze_qvm_exit_predicate.py docs/research/qvm-exit-predicate.json
2158
+ edge docs/research/qvm-exit-predicate.json scripts/test_qvm_exit_predicate.py
2159
+ group exit-predicate scripts/analyze_qvm_exit_predicate.py
2160
+ edge scripts/analyze_qvm_exit_predicate.py scripts/analyze_qvm_resumer_audit.py
2161
+ edge scripts/qvm_intermission_support.py scripts/analyze_qvm_resumer_audit.py