nmarshall commited on
Commit
29c0ea6
·
1 Parent(s): a5dc227

qvm: compose large ranking caller

Browse files
docs/FINDINGS.md CHANGED
@@ -1373,3 +1373,6 @@ RE-780–789 exposes and bounds legacy resumer timing/byte-state flaws, migrates
1373
 
1374
 
1375
  **RE-791:** Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. [Evidence](research/QVM_CHILD_WORD_MEMORY.md).
 
 
 
 
1373
 
1374
 
1375
  **RE-791:** Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. [Evidence](research/QVM_CHILD_WORD_MEMORY.md).
1376
+
1377
+
1378
+ **RE-792:** 5864 now composes actual35095 sorting and rank writes over80 larger eligible populations with explicit publication captures. [Evidence](research/QVM_RANKING_LARGE_CALLER.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1377,3 +1377,6 @@ RE-780–789 batch validation: 1,537 Python and 92 Rust tests pass;216 affected
1377
 
1378
 
1379
  RE-791: Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. Full runtime completion remains open. [Evidence](research/QVM_CHILD_WORD_MEMORY.md).
 
 
 
 
1377
 
1378
 
1379
  RE-791: Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. Full runtime completion remains open. [Evidence](research/QVM_CHILD_WORD_MEMORY.md).
1380
+
1381
+
1382
+ RE-792: 5864 now composes actual35095 sorting and rank writes over80 larger eligible populations with explicit publication captures. Full runtime completion remains open. [Evidence](research/QVM_RANKING_LARGE_CALLER.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -1619,3 +1619,8 @@ After exactly ten task commits from `78ab0c4b`, the single `cargo xtask test-ful
1619
  ## 2026-10-26 — RE-791 Explicit child word synchronization at corrected call boundaries
1620
 
1621
  Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. Focused `cargo xtask test-group child-word-memory` passes (6 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.
 
 
 
 
 
 
1619
  ## 2026-10-26 — RE-791 Explicit child word synchronization at corrected call boundaries
1620
 
1621
  Both resumers can synchronize new and changed child words into byte lanes without erasing unchanged parent byte overlays. Focused `cargo xtask test-group child-word-memory` passes (6 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.
1622
+
1623
+
1624
+ ## 2026-10-26 — RE-792 Complete ranking caller with actual partitioned sorting through64 clients
1625
+
1626
+ 5864 now composes actual35095 sorting and rank writes over80 larger eligible populations with explicit publication captures. Focused `cargo xtask test-group ranking-large-caller` 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
@@ -1423,3 +1423,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1423
 
1424
 
1425
  - [x] RE-791 Explicit child word synchronization at corrected call boundaries ([evidence](research/QVM_CHILD_WORD_MEMORY.md)).
 
 
 
 
1423
 
1424
 
1425
  - [x] RE-791 Explicit child word synchronization at corrected call boundaries ([evidence](research/QVM_CHILD_WORD_MEMORY.md)).
1426
+
1427
+
1428
+ - [x] RE-792 Complete ranking caller with actual partitioned sorting through64 clients ([evidence](research/QVM_RANKING_LARGE_CALLER.md)).
docs/research/QVM_RANKING_LARGE_CALLER.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Complete ranking caller with actual partitioned sorting through64 clients
2
+
3
+ RE-792. Reproduce with `python3 scripts/analyze_qvm_ranking_large_caller.py`; focused validation: `cargo xtask test-group ranking-large-caller`. [Machine report](qvm-ranking-large-caller.json).
4
+
5
+ Eighty source fixtures cover five sizes7..64, four modes, partial ties, both publication gates and all team-score outcomes. Tests independently check comparator-equivalent order, permutation, tied rank flags, count globals and captured request order. All recovered sort children execute and parent child-word synchronization is explicit. Publication7805/6328 and native effects remain bounded captures.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -963,3 +963,6 @@ The extension collector adds five focused tests for native tail calls, command-r
963
 
964
 
965
  [RE-791: Explicit child word synchronization at corrected call boundaries](QVM_CHILD_WORD_MEMORY.md).
 
 
 
 
963
 
964
 
965
  [RE-791: Explicit child word synchronization at corrected call boundaries](QVM_CHILD_WORD_MEMORY.md).
966
+
967
+
968
+ [RE-792: Complete ranking caller with actual partitioned sorting through64 clients](QVM_RANKING_LARGE_CALLER.md).
docs/research/qvm-ranking-large-caller.json ADDED
The diff for this file is too large to render. See raw diff
 
docs/research/qvm-resumer-audit.json CHANGED
@@ -8971,6 +8971,54 @@
8971
  "repeated_calls_opt_in": true,
8972
  "repeated_calls_setting": "literal_true"
8973
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8974
  {
8975
  "backward_conditional_branches": [
8976
  285483
@@ -9338,8 +9386,8 @@
9338
  }
9339
  },
9340
  "summary": {
9341
- "call_expressions": 184,
9342
- "files": 143,
9343
  "legacy_expressions": 159,
9344
  "nonliteral_ranges": 22,
9345
  "unresolved_mode_expressions": 3
 
8971
  "repeated_calls_opt_in": true,
8972
  "repeated_calls_setting": "literal_true"
8973
  },
8974
+ {
8975
+ "backward_conditional_branches": [
8976
+ 5903,
8977
+ 6085,
8978
+ 6170,
8979
+ 6315
8980
+ ],
8981
+ "calls": [
8982
+ {
8983
+ "dynamic_store_requires_review": false,
8984
+ "implicit_local_offset": null,
8985
+ "instruction": 6096,
8986
+ "stores_result": false,
8987
+ "target": 35095
8988
+ },
8989
+ {
8990
+ "dynamic_store_requires_review": false,
8991
+ "implicit_local_offset": 44,
8992
+ "instruction": 6103,
8993
+ "stores_result": true,
8994
+ "target": 33715
8995
+ },
8996
+ {
8997
+ "dynamic_store_requires_review": false,
8998
+ "implicit_local_offset": null,
8999
+ "instruction": 6317,
9000
+ "stores_result": false,
9001
+ "target": 7805
9002
+ },
9003
+ {
9004
+ "dynamic_store_requires_review": false,
9005
+ "implicit_local_offset": null,
9006
+ "instruction": 6324,
9007
+ "stores_result": false,
9008
+ "target": 6328
9009
+ }
9010
+ ],
9011
+ "explicit_result_offsets": null,
9012
+ "helper": "qvm_trace_support.resume",
9013
+ "line": 15,
9014
+ "literal_range": [
9015
+ 5865,
9016
+ 6326
9017
+ ],
9018
+ "path": "scripts/qvm_ranking_caller_support.py",
9019
+ "repeated_calls_opt_in": true,
9020
+ "repeated_calls_setting": "literal_true"
9021
+ },
9022
  {
9023
  "backward_conditional_branches": [
9024
  285483
 
9386
  }
9387
  },
9388
  "summary": {
9389
+ "call_expressions": 185,
9390
+ "files": 144,
9391
  "legacy_expressions": 159,
9392
  "nonliteral_ranges": 22,
9393
  "unresolved_mode_expressions": 3
scripts/analyze_qvm_ranking_large_caller.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import itertools
3
+ from pathlib import Path
4
+ from qvm_research_support import source
5
+ from qvm_ranking_caller_support import ranking
6
+ from analyze_qvm import write_json
7
+
8
+ def main():
9
+ q,raw,h,ins=source();rows=[]
10
+ for mode,n,ties,blocked in itertools.product([0,3,9,11],[7,8,16,41,64],[False,True],[0,1]):
11
+ clients=[{'248':(j%5 if ties else n-j),'280':j%3,'3032':j%4,'308':j%5 if ties else n-j,'696':j%5 if ties else n-j} for j in range(n)];scores=[(2,1),(1,2),(1,1)][n%3];rows.append(ranking(ins,mode,clients,scores,blocked)[1])
12
+ write_json(Path('docs/research/qvm-ranking-large-caller.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Complete5864 with actual aligned35095 and recovered helpers across80 eligible n7..64 fixtures.7805/6328 remain captured. Parent explicitly synchronizes child words. Tied order may be unstable; rank ties are assigned from actual source ordering. Native publication and runtime ownership remain open.'})
13
+ if __name__=='__main__':main()
scripts/qvm_ranking_caller_support.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Complete5864 with source35095 sort and explicit publication boundaries."""
2
+ from qvm_rank_compare_support import seed
3
+ from qvm_rank_large_sort_support import sort
4
+ from qvm_notification_support import CPOOL,POOL
5
+ from qvm_contact_support import predicate
6
+ from qvm_trace_support import resume,captured
7
+ from analyze_qvm_ranking_setup import R,GLOBALS
8
+ from analyze_qvm_rank_large_sort import summarize
9
+
10
+ def ranking(ins,mode,clients,scores=(2,1),blocked=0,broadcast=None):
11
+ if len(clients)>64:raise ValueError('ranking fixture exceeds64 clients')
12
+ m=seed(mode,clients);m.update({g:0x55555555 for g in GLOBALS});m.update({34992524:len(clients),34999596:blocked,34992556:scores[0],34992560:scores[1]})
13
+ for j,c in enumerate(clients):m[POOL+880*j+424]=c.get('flags',0);m[CPOOL+6336*j+256]=77
14
+ requests=[];hs={35095:sort,33715:predicate,7805:captured(7805,requests),6328:broadcast or captured(6328,requests)}
15
+ m,e=resume(ins,5865,6326,m,R,handlers=hs,repeated_calls=True,sync_child_words=True,limit=16384)
16
+ count=m[34992580];child=next(c['effect'] for c in e['children'] if c['call']['target']==35095)
17
+ return m,{'input':{'mode':mode,'clients':clients,'blocked':blocked,'team_scores':list(scores)},'order':[m[34992592+4*j] for j in range(count)],'ranks':[m[CPOOL+6336*j+256]&0xffffffff for j in range(len(clients))],'globals':{str(a):m[a] for a in GLOBALS},'requests':requests,'execution':{k:e[k] for k in ['stop','trace_length','trace_sha256','calls']},'sort':summarize(child)}
scripts/test_qvm_ranking_large_caller.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import functools,json,unittest
2
+ from pathlib import Path
3
+ from test_qvm_rank_comparator import compare
4
+
5
+ def ranks(mode,clients,order,scores,initial=77,playing=None):
6
+ result=[initial]*len(clients)
7
+ if mode>=3 and mode not in [9,11]:
8
+ for j in order:result[j]=2 if scores[0]==scores[1] else int(scores[0]<scores[1])
9
+ return result
10
+ previous=None;base=0;order=order if playing is None else order[:playing]
11
+ for k,j in enumerate(order):
12
+ key=clients[j].get('308' if mode==9 else '696' if mode==11 else '248',0)
13
+ if k==0 or key!=previous:base=k;result[j]=base
14
+ else:result[order[k-1]]=base|16384;result[j]=base|16384
15
+ previous=key
16
+ return result
17
+ class LargeRankingCallerTests(unittest.TestCase):
18
+ @classmethod
19
+ def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-ranking-large-caller.json').read_text())['probes']
20
+ def test_numeric_order_permutation_and_rank_ties(self):
21
+ self.assertEqual(len(self.ps),80)
22
+ for p in self.ps:
23
+ a=p['input'];c=a['clients'];cmp=lambda x,y:compare(a['mode'],c[x],c[y]);expected=sorted(range(len(c)),key=functools.cmp_to_key(cmp));self.assertEqual(sorted(p['order']),list(range(len(c))));self.assertTrue(all(cmp(x,y)==0 for x,y in zip(p['order'],expected)));self.assertEqual(p['ranks'],ranks(a['mode'],c,p['order'],a['team_scores']))
24
+ def test_globals_publication_boundary_and_actual_sort(self):
25
+ for p in self.ps:
26
+ a=p['input'];n=len(a['clients']);self.assertEqual(p['globals'],{'34992848':0,'34992852':1,'34992580':n,'34992584':n,'34992588':n,'34994928':n,'34997012':n,'34997016':0});self.assertEqual([r['target'] for r in p['requests']],[7805]+([6328] if a['blocked'] else []));self.assertEqual(p['execution']['stop'],6326);self.assertEqual(p['sort']['count'],n)
27
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -1781,3 +1781,8 @@ edge docs/research/qvm-child-word-memory.json scripts/test_qvm_child_word_memory
1781
  group child-word-memory scripts/analyze_qvm_child_word_memory.py
1782
  edge scripts/analyze_qvm_child_word_memory.py scripts/analyze_qvm_resumer_audit.py
1783
  edge scripts/qvm_child_memory_support.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
1781
  group child-word-memory scripts/analyze_qvm_child_word_memory.py
1782
  edge scripts/analyze_qvm_child_word_memory.py scripts/analyze_qvm_resumer_audit.py
1783
  edge scripts/qvm_child_memory_support.py scripts/analyze_qvm_resumer_audit.py
1784
+ report scripts/analyze_qvm_ranking_large_caller.py docs/research/qvm-ranking-large-caller.json
1785
+ edge docs/research/qvm-ranking-large-caller.json scripts/test_qvm_ranking_large_caller.py
1786
+ group ranking-large-caller scripts/analyze_qvm_ranking_large_caller.py
1787
+ edge scripts/analyze_qvm_ranking_large_caller.py scripts/analyze_qvm_resumer_audit.py
1788
+ edge scripts/qvm_ranking_caller_support.py scripts/analyze_qvm_resumer_audit.py