qvm: recover statistic totals
Browse files- docs/ASSET_PIPELINE_TODO.md +3 -0
- docs/FINDINGS.md +3 -0
- docs/PROVISIONAL_TODO.md +3 -0
- docs/RESEARCH_LEDGER.md +5 -0
- docs/REVERSE_ENGINEERING_TODO.md +3 -0
- docs/research/QVM_STAT_TOTALS.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-stat-totals.json +0 -0
- scripts/analyze_qvm_stat_totals.py +14 -0
- scripts/qvm_stat_totals_support.py +24 -0
- scripts/test_qvm_stat_totals.py +21 -0
- xtask/checks.tsv +3 -0
docs/ASSET_PIPELINE_TODO.md
CHANGED
|
@@ -931,3 +931,6 @@ Research progress: RE-755 [report](research/RUST_METHOD_STATS.md); original asse
|
|
| 931 |
|
| 932 |
|
| 933 |
Research progress: RE-756 [report](research/RUST_CROSS_CLIENT_CLEAR.md); original assets unchanged.
|
|
|
|
|
|
|
|
|
|
|
|
| 931 |
|
| 932 |
|
| 933 |
Research progress: RE-756 [report](research/RUST_CROSS_CLIENT_CLEAR.md); original assets unchanged.
|
| 934 |
+
|
| 935 |
+
|
| 936 |
+
Research progress: RE-758 [report](research/QVM_STAT_TOTALS.md); original assets unchanged.
|
docs/FINDINGS.md
CHANGED
|
@@ -1277,3 +1277,6 @@ RE-725–734 batch: [health, contact and Rust impulse findings](research/QVM_HEA
|
|
| 1277 |
|
| 1278 |
|
| 1279 |
**RE-756 — Rust cross client clearing and score statistics batch handoff:** Rust cross-client clearing preserves the source inclusive index64 and exact logical changed-word footprint across40 sparse/dense fixtures. [Evidence](research/RUST_CROSS_CLIENT_CLEAR.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1277 |
|
| 1278 |
|
| 1279 |
**RE-756 — Rust cross client clearing and score statistics batch handoff:** Rust cross-client clearing preserves the source inclusive index64 and exact logical changed-word footprint across40 sparse/dense fixtures. [Evidence](research/RUST_CROSS_CLIENT_CLEAR.md).
|
| 1280 |
+
|
| 1281 |
+
|
| 1282 |
+
**RE-758 — Complete statistic totals field inclusion and wrapping:** 283085/283166 sum20 per-slot counters plus selected legacy fields with signed wrapping and distinct exclusions. [Evidence](research/QVM_STAT_TOTALS.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1272,3 +1272,6 @@ Research progress: RE-756 [report](research/RUST_CROSS_CLIENT_CLEAR.md); full na
|
|
| 1272 |
|
| 1273 |
|
| 1274 |
RE-747–756 batch validation:1443 Python and68 Rust tests pass after ten separately checked task commits. Score updates, recipient loops, method statistics and cross-client clearing have additional finite QVM evidence; scoring, method counters and record clearing now have Rust primitives. Actual ranking/recipient/report children, full simulation/runtime ownership, native parity, Linux and interactive Bevy/Solari completion remain open.
|
|
|
|
|
|
|
|
|
|
|
|
| 1272 |
|
| 1273 |
|
| 1274 |
RE-747–756 batch validation:1443 Python and68 Rust tests pass after ten separately checked task commits. Score updates, recipient loops, method statistics and cross-client clearing have additional finite QVM evidence; scoring, method counters and record clearing now have Rust primitives. Actual ranking/recipient/report children, full simulation/runtime ownership, native parity, Linux and interactive Bevy/Solari completion remain open.
|
| 1275 |
+
|
| 1276 |
+
|
| 1277 |
+
Research progress: RE-758 [report](research/QVM_STAT_TOTALS.md); full native/platform/game scope remains open.
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -1439,3 +1439,8 @@ Additional RE-756 selection verification: scoped `cargo test --offline --package
|
|
| 1439 |
## 2026-10-21 — RE-747–756 full batch validation
|
| 1440 |
|
| 1441 |
Exactly ten task commits follow baseline `ae4d61e7`. Each task passed focused `cargo xtask test-group` validation before its commit; no full suite ran between those commits. After commit ten, the single `cargo xtask test-full --since ae4d61e7` run passed1443 Python tests (519+357+364+203) and68 Rust tests (10 assets,30 gameplay,28 xtask). Twenty-one affected report producers regenerated twice byte-identically. Storage policy, documentation links across315 files and whitespace guards passed. All generated reports matched committed outputs and the working tree was clean after validation. The tenth commit is amended only to record the outcome. Original assets remain unchanged. Ranking, recipient callback internals, stat aggregation/reporting, full health/contact/runtime composition, original native parity, Linux and interactive Bevy/Solari gameplay remain open.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1439 |
## 2026-10-21 — RE-747–756 full batch validation
|
| 1440 |
|
| 1441 |
Exactly ten task commits follow baseline `ae4d61e7`. Each task passed focused `cargo xtask test-group` validation before its commit; no full suite ran between those commits. After commit ten, the single `cargo xtask test-full --since ae4d61e7` run passed1443 Python tests (519+357+364+203) and68 Rust tests (10 assets,30 gameplay,28 xtask). Twenty-one affected report producers regenerated twice byte-identically. Storage policy, documentation links across315 files and whitespace guards passed. All generated reports matched committed outputs and the working tree was clean after validation. The tenth commit is amended only to record the outcome. Original assets remain unchanged. Ranking, recipient callback internals, stat aggregation/reporting, full health/contact/runtime composition, original native parity, Linux and interactive Bevy/Solari gameplay remain open.
|
| 1442 |
+
|
| 1443 |
+
|
| 1444 |
+
## 2026-10-21 — RE-758 Complete statistic totals field inclusion and wrapping
|
| 1445 |
+
|
| 1446 |
+
283085/283166 sum20 per-slot counters plus selected legacy fields with signed wrapping and distinct exclusions. Focused `cargo xtask test-group stat-totals` passes (3 Python tests); selected reports regenerate twice byte-identically, with storage, links and whitespace guards. New report: 295255 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
|
@@ -1315,3 +1315,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1315 |
|
| 1316 |
|
| 1317 |
- [x] RE-756 Rust cross client clearing and score statistics batch handoff ([report](research/RUST_CROSS_CLIENT_CLEAR.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1315 |
|
| 1316 |
|
| 1317 |
- [x] RE-756 Rust cross client clearing and score statistics batch handoff ([report](research/RUST_CROSS_CLIENT_CLEAR.md)).
|
| 1318 |
+
|
| 1319 |
+
|
| 1320 |
+
- [x] RE-758 Complete statistic totals field inclusion and wrapping ([report](research/QVM_STAT_TOTALS.md)).
|
docs/research/QVM_STAT_TOTALS.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Complete statistic totals field inclusion and wrapping
|
| 2 |
+
|
| 3 |
+
RE-758. Reproduce with `python3 scripts/analyze_qvm_stat_totals.py`; validate with `cargo xtask test-group stat-totals`. See the [machine report](qvm-stat-totals.json).
|
| 4 |
+
|
| 5 |
+
Recovered both complete total functions with80 bulk/one-hot fixtures. First totals exclude legacy indices13/17; second totals exclude17. Both read20 slot entries, exceeding the19 slots currently selected by method classification. Independent field-selection and wrapping oracles verify untouched counters. Numeric slot naming and live storage ownership 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
|
@@ -867,3 +867,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 867 |
|
| 868 |
|
| 869 |
[RE-756: Rust cross client clearing and score statistics batch handoff](RUST_CROSS_CLIENT_CLEAR.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 867 |
|
| 868 |
|
| 869 |
[RE-756: Rust cross client clearing and score statistics batch handoff](RUST_CROSS_CLIENT_CLEAR.md).
|
| 870 |
+
|
| 871 |
+
|
| 872 |
+
[RE-758: Complete statistic totals field inclusion and wrapping](QVM_STAT_TOTALS.md).
|
docs/research/qvm-stat-totals.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_stat_totals.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Source totals with one-hot inclusion/exclusion and wrapping fixtures."""
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
from qvm_research_support import source
|
| 5 |
+
from qvm_stat_totals_support import seed,total,OFFSETS,TARGET,CLIENT
|
| 6 |
+
from analyze_qvm import write_json
|
| 7 |
+
|
| 8 |
+
def main():
|
| 9 |
+
q,raw,h,ins=source();rows=[]
|
| 10 |
+
cases=[('bulk-'+str(v),{str(o):v for o in OFFSETS}) for v in [0,1,0x7fffffff,0xffffffff]]+[(str(o),{str(x):7 if x==o else 0 for x in OFFSETS}) for o in OFFSETS]
|
| 11 |
+
for name,values in cases:
|
| 12 |
+
m=seed(raw,h,values);m,first,e1=total(ins,m,{8:TARGET});m,second,e2=total(ins,m,{8:TARGET},True);rows.append({'case':name,'counters':values,'first':first,'second':second,'executions':[e1,e2],'counters_after':{str(o):m[CLIENT+o]&0xffffffff for o in OFFSETS}})
|
| 13 |
+
write_json(Path('docs/research/qvm-stat-totals.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Complete283085/283166 with finite seeded counters, signed wrapping and all one-hot fields. Includes20 per-slot entries although method classification currently maps19 slots. Numeric field semantics and live counter ownership remain open.'})
|
| 14 |
+
if __name__=='__main__':main()
|
scripts/qvm_stat_totals_support.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""283085/283166 source counter totals, including the twentieth slot."""
|
| 2 |
+
from qvm_health_effects_support import H,TARGET,CLIENT,seed as health_seed
|
| 3 |
+
from qvm_trace_support import resume
|
| 4 |
+
B=H+0x120000
|
| 5 |
+
FIRST_LEGACY=[2376+4*j for j in range(18)]
|
| 6 |
+
SECOND_LEGACY=[2448+4*j for j in range(18)]
|
| 7 |
+
FIRST_SLOTS=[916+76*j for j in range(20)]
|
| 8 |
+
SECOND_SLOTS=[920+76*j for j in range(20)]
|
| 9 |
+
OFFSETS=sorted(set(FIRST_LEGACY+SECOND_LEGACY+FIRST_SLOTS+SECOND_SLOTS))
|
| 10 |
+
|
| 11 |
+
def seed(raw,h,values):
|
| 12 |
+
m=health_seed(raw,h)
|
| 13 |
+
for o in OFFSETS:m[CLIENT+o]=values.get(str(o),0)
|
| 14 |
+
return m
|
| 15 |
+
|
| 16 |
+
def total(ins,m,args,second=False):
|
| 17 |
+
start,end,frame=(283167,283242,16) if second else (283086,283165,20)
|
| 18 |
+
m[B+frame+8]=args[8];m,e=resume(ins,start,end,m,B)
|
| 19 |
+
return m,e['return'],e
|
| 20 |
+
|
| 21 |
+
def handlers():
|
| 22 |
+
def first(i,m,a):return total(i,m,a)
|
| 23 |
+
def second(i,m,a):return total(i,m,a,True)
|
| 24 |
+
return {283085:first,283166:second}
|
scripts/test_qvm_stat_totals.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
def signed(v):return ((v+0x80000000)&0xffffffff)-0x80000000
|
| 5 |
+
|
| 6 |
+
def expected(c):
|
| 7 |
+
first=sum(c[str(2376+4*j)] for j in range(18) if j not in [13,17])+sum(c[str(916+76*j)] for j in range(20))
|
| 8 |
+
second=sum(c[str(2448+4*j)] for j in range(18) if j!=17)+sum(c[str(920+76*j)] for j in range(20))
|
| 9 |
+
return signed(first),signed(second)
|
| 10 |
+
class StatTotalTests(unittest.TestCase):
|
| 11 |
+
@classmethod
|
| 12 |
+
def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-stat-totals.json').read_text())['probes']
|
| 13 |
+
def test_independent_wrapping_and_field_inclusion(self):
|
| 14 |
+
for p in self.ps:self.assertEqual((p['first'],p['second']),expected(p['counters']),p['case'])
|
| 15 |
+
def test_all_fields_one_hot_and_no_counter_mutations(self):
|
| 16 |
+
self.assertEqual(len(self.ps),80)
|
| 17 |
+
for p in self.ps:self.assertEqual(p['counters_after'],p['counters'])
|
| 18 |
+
def test_no_children_and_actual_returns(self):
|
| 19 |
+
for p in self.ps:
|
| 20 |
+
for e,v in zip(p['executions'],[p['first'],p['second']]):self.assertEqual(e['calls'],[]);self.assertEqual(e['return'],v)
|
| 21 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -1272,3 +1272,6 @@ edge crates/urt-gameplay/src/record_clear.rs scripts/analyze_rust_health_impulse
|
|
| 1272 |
group gameplay scripts/analyze_rust_cross_client_clear.py
|
| 1273 |
report scripts/analyze_rust_cross_client_clear.py docs/research/rust-cross-client-clear.json
|
| 1274 |
edge docs/research/rust-cross-client-clear.json scripts/test_rust_cross_client_clear.py
|
|
|
|
|
|
|
|
|
|
|
|
| 1272 |
group gameplay scripts/analyze_rust_cross_client_clear.py
|
| 1273 |
report scripts/analyze_rust_cross_client_clear.py docs/research/rust-cross-client-clear.json
|
| 1274 |
edge docs/research/rust-cross-client-clear.json scripts/test_rust_cross_client_clear.py
|
| 1275 |
+
report scripts/analyze_qvm_stat_totals.py docs/research/qvm-stat-totals.json
|
| 1276 |
+
edge docs/research/qvm-stat-totals.json scripts/test_qvm_stat_totals.py
|
| 1277 |
+
group stat-totals scripts/analyze_qvm_stat_totals.py
|