nmarshall commited on
Commit
b913272
·
1 Parent(s): 799143f

qvm: recover ranking comparator

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -961,3 +961,6 @@ Research progress: RE-766 [report](research/RUST_RECENT_AWARDS.md); original ass
961
 
962
 
963
  Research progress: RE-767 [report](research/RUST_RECIPIENT_PAYLOAD.md); original assets unchanged.
 
 
 
 
961
 
962
 
963
  Research progress: RE-767 [report](research/RUST_RECIPIENT_PAYLOAD.md); original assets unchanged.
964
+
965
+
966
+ Research progress: RE-769 [report](research/QVM_RANK_COMPARATOR.md); original assets unchanged.
docs/FINDINGS.md CHANGED
@@ -1307,3 +1307,6 @@ RE-725–734 batch: [health, contact and Rust impulse findings](research/QVM_HEA
1307
 
1308
 
1309
  **RE-767 — Rust recipient numeric projection and reporting batch handoff:** Rust recipient participant gates, numeric fields and cache effects match72 single and73 pair source fixtures, including self aliases. [Evidence](research/RUST_RECIPIENT_PAYLOAD.md).
 
 
 
 
1307
 
1308
 
1309
  **RE-767 — Rust recipient numeric projection and reporting batch handoff:** Rust recipient participant gates, numeric fields and cache effects match72 single and73 pair source fixtures, including self aliases. [Evidence](research/RUST_RECIPIENT_PAYLOAD.md).
1310
+
1311
+
1312
+ **RE-769 — Complete ranking comparator gates ties and mode priorities:** 5441 preserves mode-specific score/time/class priorities and returns non-ordering results for some deferred/connecting pairs. [Evidence](research/QVM_RANK_COMPARATOR.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1305,3 +1305,6 @@ Research progress: RE-767 [report](research/RUST_RECIPIENT_PAYLOAD.md); full nat
1305
 
1306
 
1307
  RE-758–767 batch validation:1473 Python and80 Rust tests pass after ten independently committed tasks. Totals/ratios, team counters, recent awards, recipient numeric bodies and ranking setup have finite source evidence; Rust adds totals/ratios, recent-award records and recipient numeric/cache contracts. Ranking sort/publication, real serialization, full runtime ownership, native parity, Linux and interactive Bevy/Solari acceptance remain open.
 
 
 
 
1305
 
1306
 
1307
  RE-758–767 batch validation:1473 Python and80 Rust tests pass after ten independently committed tasks. Totals/ratios, team counters, recent awards, recipient numeric bodies and ranking setup have finite source evidence; Rust adds totals/ratios, recent-award records and recipient numeric/cache contracts. Ranking sort/publication, real serialization, full runtime ownership, native parity, Linux and interactive Bevy/Solari acceptance remain open.
1308
+
1309
+
1310
+ Research progress: RE-769 [report](research/QVM_RANK_COMPARATOR.md); full native/platform/game scope remains open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -1498,3 +1498,8 @@ Additional RE-767 selector verification: scoped `cargo test --offline --package
1498
  ## 2026-10-21 — RE-758–767 full batch validation
1499
 
1500
  Exactly ten task commits follow baseline `27a7f96f`. Every completed task passed focused `cargo xtask test-group` checks before its final commit; no full suite ran between those task commits. After commit ten, the single `cargo xtask test-full --since 27a7f96f` run passed1473 Python tests (519+357+352+245) and80 Rust tests (10 assets,42 gameplay,28 xtask). Seventeen affected report producers regenerated twice byte-identically. Storage policy, documentation links across326 files and whitespace guards passed. Generated outputs matched committed reports and the working tree was clean after validation. The tenth commit is amended only to record this result. Original assets remain unchanged. Ranking sort/publication, actual text serialization, statistic leaderboards, full lifecycle/runtime composition, original native parity, Linux and interactive Bevy/Solari gameplay remain open.
 
 
 
 
 
 
1498
  ## 2026-10-21 — RE-758–767 full batch validation
1499
 
1500
  Exactly ten task commits follow baseline `27a7f96f`. Every completed task passed focused `cargo xtask test-group` checks before its final commit; no full suite ran between those task commits. After commit ten, the single `cargo xtask test-full --since 27a7f96f` run passed1473 Python tests (519+357+352+245) and80 Rust tests (10 assets,42 gameplay,28 xtask). Seventeen affected report producers regenerated twice byte-identically. Storage policy, documentation links across326 files and whitespace guards passed. Generated outputs matched committed reports and the working tree was clean after validation. The tenth commit is amended only to record this result. Original assets remain unchanged. Ranking sort/publication, actual text serialization, statistic leaderboards, full lifecycle/runtime composition, original native parity, Linux and interactive Bevy/Solari gameplay remain open.
1501
+
1502
+
1503
+ ## 2026-10-21 — RE-769 Complete ranking comparator gates ties and mode priorities
1504
+
1505
+ 5441 preserves mode-specific score/time/class priorities and returns non-ordering results for some deferred/connecting pairs. Focused `cargo xtask test-group rank-comparator` passes (3 Python tests); selected reports regenerate twice byte-identically, with storage, links and whitespace guards. New report: 136008 bytes. Full-suite validation is deferred to the tenth batch commit. No original assets, Rust runtime or shared VM evaluator changed.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -1348,3 +1348,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1348
 
1349
 
1350
  - [x] RE-767 Rust recipient numeric projection and reporting batch handoff ([report](research/RUST_RECIPIENT_PAYLOAD.md)).
 
 
 
 
1348
 
1349
 
1350
  - [x] RE-767 Rust recipient numeric projection and reporting batch handoff ([report](research/RUST_RECIPIENT_PAYLOAD.md)).
1351
+
1352
+
1353
+ - [x] RE-769 Complete ranking comparator gates ties and mode priorities ([report](research/QVM_RANK_COMPARATOR.md)).
docs/research/QVM_RANK_COMPARATOR.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Complete ranking comparator gates ties and mode priorities
2
+
3
+ RE-769. Reproduce with `python3 scripts/analyze_qvm_rank_comparator.py`; validate with `cargo xtask test-group rank-comparator`. See the [machine report](qvm-rank-comparator.json).
4
+
5
+ Recovered complete5441 with actual33715 across232 profiles. Deferred first clients and connecting first clients return+1 before symmetric checks, so this must not be treated as an unconditional Rust Ord implementation. Mode9 handles zero time specially, mode11 prioritizes class, ordinary modes prioritize score/deaths and supported team modes use awards as a final tie breaker. Native sorting and runtime parity remain open.
6
+
7
+ No original executable/full VM/native world collision or rendering runs. Supplied callback/native responses and fixture domains remain explicit; complete macOS/Linux Rust/Bevy/Solari gameplay remains open.
docs/research/README.md CHANGED
@@ -897,3 +897,6 @@ The extension collector adds five focused tests for native tail calls, command-r
897
 
898
 
899
  [RE-767: Rust recipient numeric projection and reporting batch handoff](RUST_RECIPIENT_PAYLOAD.md).
 
 
 
 
897
 
898
 
899
  [RE-767: Rust recipient numeric projection and reporting batch handoff](RUST_RECIPIENT_PAYLOAD.md).
900
+
901
+
902
+ [RE-769: Complete ranking comparator gates ties and mode priorities](QVM_RANK_COMPARATOR.md).
docs/research/qvm-rank-comparator.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_rank_comparator.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Complete5441 comparator, priority gates, mode-specific numeric order."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source
6
+ from qvm_rank_compare_support import seed,compare,PTR
7
+ from analyze_qvm import write_json
8
+
9
+ def main():
10
+ q,raw,h,ins=source();rows=[];profiles=[{}, {'3108':3},{'3112':-1},{'468':1},{'3096':3,'3104':10},{'3096':3,'3104':20}]
11
+ cases=[(mode,a,b) for mode,a,b in itertools.product([0,3,9,11],profiles,profiles)]
12
+ cases += [(mode,{'308':a,'696':a,'248':a,'280':a,'3032':a},{'308':b,'696':b,'248':b,'280':b,'3032':b}) for mode,a,b in itertools.product([0,3,9,11],[-2,0,1,10],[-2,0,1,10])]
13
+ cases += [(mode,{str(field):v},{}) for mode,field,v in itertools.product([0,3,9,11],[248,280,3032],[-1,1])]
14
+ for mode,a,b in cases:
15
+ m=seed(mode,[a,b]);m[PTR]=0;m[PTR+4]=1;_,v,e=compare(ins,m,{8:PTR,12:PTR+4});rows.append({'input':{'mode':mode,'first':a,'second':b},'result':v,'execution':e})
16
+ write_json(Path('docs/research/qvm-rank-comparator.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Complete5441 with actual33715. Raw comparator can return+1 in both directions for two deferred/connecting clients; no universal strict ordering is claimed. Finite numeric profiles, no native sort/runtime parity.'})
17
+ if __name__=='__main__':main()
scripts/qvm_rank_compare_support.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """5441 source comparator; raw results preserve non-ordering prefilter quirks."""
2
+ from qvm_health_effects_support import H
3
+ from qvm_notification_support import CPOOL
4
+ from qvm_trace_support import resume
5
+ from qvm_contact_support import predicate
6
+ K=H+0x1a0000
7
+ PTR=K+0x1000
8
+ FIELDS=[3108,3112,468,3096,3104,308,696,248,280,3032]
9
+ DEFAULT={3108:0,3112:0,468:2,3096:1,3104:0,308:0,696:0,248:0,280:0,3032:0}
10
+
11
+ def seed(mode,clients):
12
+ m={34992496:CPOOL,34090788:mode}
13
+ for j,c in enumerate(clients):
14
+ for o,v in DEFAULT.items():m[CPOOL+6336*j+o]=c.get(str(o),v)
15
+ return m
16
+
17
+ def compare(ins,m,args):
18
+ m[K+52]=args[8];m[K+56]=args[12];m,e=resume(ins,5442,5863,m,K,handlers={33715:predicate});return m,e['return'],e
scripts/test_qvm_rank_comparator.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+
4
+ def compare(mode,a,b):
5
+ v=lambda c,o,d=0:c.get(str(o),d)
6
+ if v(a,3108)==3 or v(a,3112)<0:return 1
7
+ if v(b,3108)==3 or v(b,3112)<0:return -1
8
+ if v(a,468,2)==1:return 1
9
+ if v(b,468,2)==1:return -1
10
+ if v(a,3096,1)==3 and v(b,3096,1)==3:return (v(a,3104)>v(b,3104))-(v(a,3104)<v(b,3104))
11
+ if v(a,3096,1)==3:return 1
12
+ if v(b,3096,1)==3:return -1
13
+ if mode==9:
14
+ x,y=v(a,308),v(b,308)
15
+ if x and not y or x and y and x<y:return -1
16
+ if y and not x or x and y and x>y:return 1
17
+ if x==y:return 0
18
+ if mode==11 and v(a,696)!=v(b,696):return -1 if v(a,696)>v(b,696) else 1
19
+ if mode!=9:
20
+ if v(a,248)!=v(b,248):return -1 if v(a,248)>v(b,248) else 1
21
+ if v(a,280)!=v(b,280):return 1 if v(a,280)>v(b,280) else -1
22
+ if mode>=3 and mode not in [9,11] and v(a,3032)!=v(b,3032):return -1 if v(a,3032)>v(b,3032) else 1
23
+ return 0
24
+ class RankComparatorTests(unittest.TestCase):
25
+ @classmethod
26
+ def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-rank-comparator.json').read_text())['probes']
27
+ def test_independent_priority_and_mode_oracle(self):
28
+ for p in self.ps:a=p['input'];self.assertEqual(p['result'],compare(a['mode'],a['first'],a['second']),a)
29
+ def test_complete_return_and_mode_child_only(self):
30
+ for p in self.ps:self.assertEqual(p['execution']['return'],p['result']);self.assertTrue(all(c['target']==33715 for c in p['execution']['calls']))
31
+ def test_prefilter_nonreflexivity_is_preserved(self):
32
+ self.assertEqual(len(self.ps),232);self.assertTrue(any(p['input']['first']==p['input']['second']=={'3108':3} and p['result']==1 for p in self.ps))
33
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -1323,3 +1323,6 @@ edge crates/urt-gameplay/src/recipient_payload.rs scripts/analyze_rust_health_im
1323
  group gameplay scripts/analyze_rust_recipient_payload.py
1324
  report scripts/analyze_rust_recipient_payload.py docs/research/rust-recipient-payload.json
1325
  edge docs/research/rust-recipient-payload.json scripts/test_rust_recipient_payload.py
 
 
 
 
1323
  group gameplay scripts/analyze_rust_recipient_payload.py
1324
  report scripts/analyze_rust_recipient_payload.py docs/research/rust-recipient-payload.json
1325
  edge docs/research/rust-recipient-payload.json scripts/test_rust_recipient_payload.py
1326
+ report scripts/analyze_qvm_rank_comparator.py docs/research/qvm-rank-comparator.json
1327
+ edge docs/research/qvm-rank-comparator.json scripts/test_qvm_rank_comparator.py
1328
+ group rank-comparator scripts/analyze_qvm_rank_comparator.py