qvm: compose large ranking caller
Browse filesFiles changed (12)
- docs/FINDINGS.md+3
- docs/PROVISIONAL_TODO.md+3
- docs/RESEARCH_LEDGER.md+5
- docs/REVERSE_ENGINEERING_TODO.md+3
- docs/research/QVM_RANKING_LARGE_CALLER.mdAdded+7
- docs/research/README.md+3
- docs/research/qvm-ranking-large-caller.jsonAdded
- docs/research/qvm-resumer-audit.json+50-2
- scripts/analyze_qvm_ranking_large_caller.pyAdded+13
- scripts/qvm_ranking_caller_support.pyAdded+17
- scripts/test_qvm_ranking_large_caller.pyAdded+27
- xtask/checks.tsv+5
1372 unmodified lines1373137413751372 unmodified lines**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).1372 unmodified lines1373137413751376137713781372 unmodified lines**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).**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).
1376 unmodified lines1377137813791376 unmodified linesRE-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).1376 unmodified lines1377137813791380138113821376 unmodified linesRE-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).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).
1618 unmodified lines1619162016211618 unmodified lines## 2026-10-26 — RE-791 Explicit child word synchronization at corrected call boundariesBoth 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.1618 unmodified lines161916201621162216231624162516261618 unmodified lines## 2026-10-26 — RE-791 Explicit child word synchronization at corrected call boundariesBoth 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.## 2026-10-26 — RE-792 Complete ranking caller with actual partitioned sorting through64 clients5864 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.
1422 unmodified lines1423142414251422 unmodified lines- [x] RE-791 Explicit child word synchronization at corrected call boundaries ([evidence](research/QVM_CHILD_WORD_MEMORY.md)).1422 unmodified lines1423142414251426142714281422 unmodified lines- [x] RE-791 Explicit child word synchronization at corrected call boundaries ([evidence](research/QVM_CHILD_WORD_MEMORY.md)).- [x] RE-792 Complete ranking caller with actual partitioned sorting through64 clients ([evidence](research/QVM_RANKING_LARGE_CALLER.md)).
1234567# Complete ranking caller with actual partitioned sorting through64 clients
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).
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.
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.962 unmodified lines963964965962 unmodified lines[RE-791: Explicit child word synchronization at corrected call boundaries](QVM_CHILD_WORD_MEMORY.md).962 unmodified lines963964965966967968962 unmodified lines[RE-791: Explicit child word synchronization at corrected call boundaries](QVM_CHILD_WORD_MEMORY.md).[RE-792: Complete ranking caller with actual partitioned sorting through64 clients](QVM_RANKING_LARGE_CALLER.md).
8970 unmodified lines897189728973897489758976361 unmodified lines933893399340934193429343934493458970 unmodified lines"repeated_calls_opt_in": true,"repeated_calls_setting": "literal_true"},{"backward_conditional_branches": [285483361 unmodified lines}},"summary": {"call_expressions": 184,"files": 143,"legacy_expressions": 159,"nonliteral_ranges": 22,"unresolved_mode_expressions": 38970 unmodified lines897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024361 unmodified lines938693879388938993909391939293938970 unmodified lines"repeated_calls_opt_in": true,"repeated_calls_setting": "literal_true"},{"backward_conditional_branches": [5903,6085,6170,6315],"calls": [{"dynamic_store_requires_review": false,"implicit_local_offset": null,"instruction": 6096,"stores_result": false,"target": 35095},{"dynamic_store_requires_review": false,"implicit_local_offset": 44,"instruction": 6103,"stores_result": true,"target": 33715},{"dynamic_store_requires_review": false,"implicit_local_offset": null,"instruction": 6317,"stores_result": false,"target": 7805},{"dynamic_store_requires_review": false,"implicit_local_offset": null,"instruction": 6324,"stores_result": false,"target": 6328}],"explicit_result_offsets": null,"helper": "qvm_trace_support.resume","line": 15,"literal_range": [5865,6326],"path": "scripts/qvm_ranking_caller_support.py","repeated_calls_opt_in": true,"repeated_calls_setting": "literal_true"},{"backward_conditional_branches": [285483361 unmodified lines}},"summary": {"call_expressions": 185,"files": 144,"legacy_expressions": 159,"nonliteral_ranges": 22,"unresolved_mode_expressions": 3
12345678910111213#!/usr/bin/env python3import itertoolsfrom pathlib import Pathfrom qvm_research_support import sourcefrom qvm_ranking_caller_support import rankingfrom analyze_qvm import write_json
def main(): q,raw,h,ins=source();rows=[] for mode,n,ties,blocked in itertools.product([0,3,9,11],[7,8,16,41,64],[False,True],[0,1]): 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]) 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.'})if __name__=='__main__':main()1234567891011121314151617"""Complete5864 with source35095 sort and explicit publication boundaries."""from qvm_rank_compare_support import seedfrom qvm_rank_large_sort_support import sortfrom qvm_notification_support import CPOOL,POOLfrom qvm_contact_support import predicatefrom qvm_trace_support import resume,capturedfrom analyze_qvm_ranking_setup import R,GLOBALSfrom analyze_qvm_rank_large_sort import summarize
def ranking(ins,mode,clients,scores=(2,1),blocked=0,broadcast=None): if len(clients)>64:raise ValueError('ranking fixture exceeds64 clients') 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]}) for j,c in enumerate(clients):m[POOL+880*j+424]=c.get('flags',0);m[CPOOL+6336*j+256]=77 requests=[];hs={35095:sort,33715:predicate,7805:captured(7805,requests),6328:broadcast or captured(6328,requests)} m,e=resume(ins,5865,6326,m,R,handlers=hs,repeated_calls=True,sync_child_words=True,limit=16384) count=m[34992580];child=next(c['effect'] for c in e['children'] if c['call']['target']==35095) 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)}123456789101112131415161718192021222324252627import functools,json,unittestfrom pathlib import Pathfrom test_qvm_rank_comparator import compare
def ranks(mode,clients,order,scores,initial=77,playing=None): result=[initial]*len(clients) if mode>=3 and mode not in [9,11]: for j in order:result[j]=2 if scores[0]==scores[1] else int(scores[0]<scores[1]) return result previous=None;base=0;order=order if playing is None else order[:playing] for k,j in enumerate(order): key=clients[j].get('308' if mode==9 else '696' if mode==11 else '248',0) if k==0 or key!=previous:base=k;result[j]=base else:result[order[k-1]]=base|16384;result[j]=base|16384 previous=key return resultclass LargeRankingCallerTests(unittest.TestCase): @classmethod def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-ranking-large-caller.json').read_text())['probes'] def test_numeric_order_permutation_and_rank_ties(self): self.assertEqual(len(self.ps),80) for p in self.ps: 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'])) def test_globals_publication_boundary_and_actual_sort(self): for p in self.ps: 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)if __name__=='__main__':unittest.main()1780 unmodified lines1781178217831780 unmodified linesgroup child-word-memory scripts/analyze_qvm_child_word_memory.pyedge scripts/analyze_qvm_child_word_memory.py scripts/analyze_qvm_resumer_audit.pyedge scripts/qvm_child_memory_support.py scripts/analyze_qvm_resumer_audit.py1780 unmodified lines178117821783178417851786178717881780 unmodified linesgroup child-word-memory scripts/analyze_qvm_child_word_memory.pyedge scripts/analyze_qvm_child_word_memory.py scripts/analyze_qvm_resumer_audit.pyedge scripts/qvm_child_memory_support.py scripts/analyze_qvm_resumer_audit.pyreport scripts/analyze_qvm_ranking_large_caller.py docs/research/qvm-ranking-large-caller.jsonedge docs/research/qvm-ranking-large-caller.json scripts/test_qvm_ranking_large_caller.pygroup ranking-large-caller scripts/analyze_qvm_ranking_large_caller.pyedge scripts/analyze_qvm_ranking_large_caller.py scripts/analyze_qvm_resumer_audit.pyedge scripts/qvm_ranking_caller_support.py scripts/analyze_qvm_resumer_audit.py
docs/FINDINGS.md+3
docs/PROVISIONAL_TODO.md+3
docs/RESEARCH_LEDGER.md+5
docs/REVERSE_ENGINEERING_TODO.md+3
docs/research/QVM_RANKING_LARGE_CALLER.mdAdded+7
docs/research/README.md+3
docs/research/qvm-ranking-large-caller.jsonAdded
docs/research/qvm-resumer-audit.json+50-2
scripts/analyze_qvm_ranking_large_caller.pyAdded+13
scripts/qvm_ranking_caller_support.pyAdded+17
scripts/test_qvm_ranking_large_caller.pyAdded+27
xtask/checks.tsv+5