nmarshall commited on
Commit
cd0a2cf
·
1 Parent(s): dd27994

qvm: recover scoreboard row admission

Browse files
docs/FINDINGS.md CHANGED
@@ -1412,3 +1412,6 @@ RE-791–800 adds exact Rust source-sort/ranking parity, mixed count/prefix sema
1412
 
1413
 
1414
  **RE-804:** Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. [Evidence](research/QVM_STRING_MEMORY.md).
 
 
 
 
1412
 
1413
 
1414
  **RE-804:** Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. [Evidence](research/QVM_STRING_MEMORY.md).
1415
+
1416
+
1417
+ **RE-805:** 179363 differs from single-recipient payloads: raw class is preserved, only connecting state1 forces999 ping, and overflow candidates mutate cache before rejection. [Evidence](research/QVM_SCOREBOARD_ROWS.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1419,3 +1419,6 @@ RE-803: Both bounded resumers now support validated child byte writes, coherent
1419
 
1420
 
1421
  RE-804: Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. Full runtime completion remains open. [Evidence](research/QVM_STRING_MEMORY.md).
 
 
 
 
1419
 
1420
 
1421
  RE-804: Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. Full runtime completion remains open. [Evidence](research/QVM_STRING_MEMORY.md).
1422
+
1423
+
1424
+ RE-805: 179363 differs from single-recipient payloads: raw class is preserved, only connecting state1 forces999 ping, and overflow candidates mutate cache before rejection. Full runtime completion remains open. [Evidence](research/QVM_SCOREBOARD_ROWS.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -1686,3 +1686,8 @@ Both bounded resumers now support validated child byte writes, coherent word mir
1686
  ## 2026-10-26 — RE-804 Actual QVM string helpers across aligned and unaligned memory
1687
 
1688
  Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. Focused `cargo xtask test-group string-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.
 
 
 
 
 
 
1686
  ## 2026-10-26 — RE-804 Actual QVM string helpers across aligned and unaligned memory
1687
 
1688
  Actual strlen36038 and strcpy36185 execute against coherent bytes, preserving destination guards; bounded copy69338 retains an explicit native strncpy model. Focused `cargo xtask test-group string-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.
1689
+
1690
+
1691
+ ## 2026-10-26 — RE-805 Original scoreboard numeric rows cache updates and packet admission
1692
+
1693
+ 179363 differs from single-recipient payloads: raw class is preserved, only connecting state1 forces999 ping, and overflow candidates mutate cache before rejection. Focused `cargo xtask test-group scoreboard-rows` 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.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -1462,3 +1462,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1462
 
1463
 
1464
  - [x] RE-804 Actual QVM string helpers across aligned and unaligned memory ([evidence](research/QVM_STRING_MEMORY.md)).
 
 
 
 
1462
 
1463
 
1464
  - [x] RE-804 Actual QVM string helpers across aligned and unaligned memory ([evidence](research/QVM_STRING_MEMORY.md)).
1465
+
1466
+
1467
+ - [x] RE-805 Original scoreboard numeric rows cache updates and packet admission ([evidence](research/QVM_SCOREBOARD_ROWS.md)).
docs/research/QVM_SCOREBOARD_ROWS.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original scoreboard numeric rows cache updates and packet admission
2
+
3
+ RE-805. Reproduce with `python3 scripts/analyze_qvm_scoreboard_rows.py`; focused validation: `cargo xtask test-group scoreboard-rows`. [Machine report](qvm-scoreboard-rows.json).
4
+
5
+ 76 original-instruction probes cover signed ping/packed fields, connection states-minus-one..3, follow cache, bot overrides, status gates and exact1024 capacity boundaries. Name strlen and bounded copy execute actual recovered children; row lengths are supplied and formatting/append/send effects remain captured. Independent models verify attempted versus accepted rows, caches including rejected candidates, header arguments and recipient ID.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1002,3 +1002,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1002
 
1003
 
1004
  [RE-804: Actual QVM string helpers across aligned and unaligned memory](QVM_STRING_MEMORY.md).
 
 
 
 
1002
 
1003
 
1004
  [RE-804: Actual QVM string helpers across aligned and unaligned memory](QVM_STRING_MEMORY.md).
1005
+
1006
+
1007
+ [RE-805: Original scoreboard numeric rows cache updates and packet admission](QVM_SCOREBOARD_ROWS.md).
docs/research/qvm-resumer-audit.json CHANGED
@@ -9136,6 +9136,79 @@
9136
  "repeated_calls_opt_in": false,
9137
  "repeated_calls_setting": "default_false"
9138
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9139
  {
9140
  "backward_conditional_branches": [
9141
  6366
@@ -9468,8 +9541,8 @@
9468
  }
9469
  },
9470
  "summary": {
9471
- "call_expressions": 189,
9472
- "files": 147,
9473
  "legacy_expressions": 158,
9474
  "nonliteral_ranges": 24,
9475
  "unresolved_mode_expressions": 3
 
9136
  "repeated_calls_opt_in": false,
9137
  "repeated_calls_setting": "default_false"
9138
  },
9139
+ {
9140
+ "backward_conditional_branches": [
9141
+ 179703
9142
+ ],
9143
+ "calls": [
9144
+ {
9145
+ "dynamic_store_requires_review": false,
9146
+ "implicit_local_offset": 2568,
9147
+ "instruction": 179534,
9148
+ "stores_result": true,
9149
+ "target": 36038
9150
+ },
9151
+ {
9152
+ "dynamic_store_requires_review": false,
9153
+ "implicit_local_offset": null,
9154
+ "instruction": 179547,
9155
+ "stores_result": false,
9156
+ "target": 69338
9157
+ },
9158
+ {
9159
+ "dynamic_store_requires_review": false,
9160
+ "implicit_local_offset": null,
9161
+ "instruction": 179561,
9162
+ "stores_result": false,
9163
+ "target": 69338
9164
+ },
9165
+ {
9166
+ "dynamic_store_requires_review": false,
9167
+ "implicit_local_offset": null,
9168
+ "instruction": 179655,
9169
+ "stores_result": false,
9170
+ "target": 70386
9171
+ },
9172
+ {
9173
+ "dynamic_store_requires_review": false,
9174
+ "implicit_local_offset": 2576,
9175
+ "instruction": 179661,
9176
+ "stores_result": true,
9177
+ "target": 36038
9178
+ },
9179
+ {
9180
+ "dynamic_store_requires_review": false,
9181
+ "implicit_local_offset": null,
9182
+ "instruction": 179684,
9183
+ "stores_result": false,
9184
+ "target": 36185
9185
+ },
9186
+ {
9187
+ "dynamic_store_requires_review": false,
9188
+ "implicit_local_offset": 2552,
9189
+ "instruction": 179719,
9190
+ "stores_result": true,
9191
+ "target": 70458
9192
+ },
9193
+ {
9194
+ "dynamic_store_requires_review": false,
9195
+ "implicit_local_offset": null,
9196
+ "instruction": 179732,
9197
+ "stores_result": false,
9198
+ "target": -18
9199
+ }
9200
+ ],
9201
+ "explicit_result_offsets": null,
9202
+ "helper": "qvm_trace_support.resume",
9203
+ "line": 31,
9204
+ "literal_range": [
9205
+ 179364,
9206
+ 179734
9207
+ ],
9208
+ "path": "scripts/qvm_scoreboard_body_support.py",
9209
+ "repeated_calls_opt_in": true,
9210
+ "repeated_calls_setting": "literal_true"
9211
+ },
9212
  {
9213
  "backward_conditional_branches": [
9214
  6366
 
9541
  }
9542
  },
9543
  "summary": {
9544
+ "call_expressions": 190,
9545
+ "files": 148,
9546
  "legacy_expressions": 158,
9547
  "nonliteral_ranges": 24,
9548
  "unresolved_mode_expressions": 3
docs/research/qvm-scoreboard-rows.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_scoreboard_rows.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import itertools
3
+ from pathlib import Path
4
+ from qvm_research_support import source
5
+ from qvm_scoreboard_body_support import seed,body,DEFAULT,CPOOL
6
+ from analyze_qvm import write_json
7
+
8
+ def main():
9
+ q,raw,h,ins=source();cases=[];rows=[]
10
+ for ping,state,follow,bot in itertools.product([-5,999,1500],[-1,0,1,2,3],[0,1],[0,8]):cases.append(([{'452':ping,'468':state,'4324':follow,'12':1024 if follow else 0,'flags':bot,'696':21 if state%2 else -1,'name_hex':'41' if bot else '4142'}],[40]))
11
+ for lengths in [[],[1024],[1025],[512,512],[512,513],[1023,1],[1023,2],[0]*64]:cases.append(([{} for _ in lengths],lengths))
12
+ for health,protected,special in itertools.product([0,100],[0,16384],[0,1]):cases.append(([{'208':health,'220':protected,'3740':special,'300':0xffff00ff}],[40]))
13
+ for clients,lengths in cases:
14
+ m,b=seed(clients);m,p=body(ins,m,b,lengths);p.update(clients=clients,lengths=lengths,now=121000,final_cache=[m[CPOOL+6336*j+6160]&0xffffffff for j in range(len(clients))]);rows.append(p)
15
+ write_json(Path('docs/research/qvm-scoreboard-rows.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual179363 including original unaligned literal copy, numeric rows, ping caches and1024-byte admission loop. Actual36038 for names and69338 wrapper; row strlen lengths supplied,70386/36185/70458/-18 captured. Unlike179736, connection!=1 uses raw ping clamp and class is not clamped. Overflow candidate cache changes precede rejection. Native formatting and wire parity unverified.'})
16
+ if __name__=='__main__':main()
scripts/qvm_scoreboard_body_support.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Actual179363 scoreboard row/capacity/cache loop; text boundaries explicit."""
2
+ from qvm_health_effects_support import H
3
+ from qvm_notification_support import CPOOL,POOL
4
+ from qvm_string_memory_support import strlen,copy_bounded
5
+ from qvm_trace_support import resume
6
+ from qvm_recipient_payload_support import FIELDS
7
+ S=H+0x600000
8
+ BODY=S+0x10000
9
+ DEFAULT={12:0,140:0,208:100,220:0,248:7,280:3,300:0x800001ff,308:17,452:70,468:2,576:1000,696:20,3032:4,3692:9,3740:0,4324:0,4336:60000,6160:77}
10
+
11
+ def seed(clients,order=None,now=121000,scores=(2,1),recipient=3):
12
+ order=list(range(len(clients))) if order is None else list(order)
13
+ if len(clients)>64 or sorted(order)!=list(range(len(clients))):raise ValueError('unsupported scoreboard order')
14
+ m={34992496:CPOOL,34992580:len(order),34992532:now,34992556:scores[0],34992560:scores[1],S+2588:POOL+880*recipient};b={69350+j:v for j,v in enumerate(b'---\0')}
15
+ for j,id in enumerate(order):m[34992592+4*j]=id
16
+ for j,c in enumerate(clients):
17
+ for o,v in DEFAULT.items():m[CPOOL+6336*j+o]=c.get(str(o),v)
18
+ m[POOL+880*j+424]=c.get('flags',0);name=bytes.fromhex(c.get('name_hex','4142'))
19
+ for k,v in enumerate(name+b'\0'+b'\0'*4):b[CPOOL+6336*j+3624+k]=v
20
+ return m,b
21
+
22
+ def body(ins,m,b,lengths):
23
+ rows=[];requests=[]
24
+ def length(i,m,a,bs):
25
+ if a[8]==S+80:return m,lengths[len(rows)-1],{'row_length_supplied':True}
26
+ return strlen(i,m,a,bs)
27
+ def row(i,m,a,bs):rows.append({'numbers':[a[o] for o in range(20,68,4)],'format':a[16]});return m,0,{'row_format_captured':True}
28
+ def append(i,m,a,bs):return m,0,{'append_captured':True}
29
+ def final(i,m,a,bs):requests.append({'target':70458,'arguments':a});return m,BODY,{'final_format_captured':True}
30
+ def send(i,m,a,bs):requests.append({'target':-18,'arguments':a});return m,0,{'send_captured':True}
31
+ m,e=resume(ins,179364,179734,m,S,handlers={36038:length,69338:copy_bounded,70386:row,36185:append,70458:final,-18:send},byte_inputs=b,repeated_calls=True,sync_child_words=True,coherent_memory=True,byte_handlers=True,limit=32768)
32
+ return m,{'rows':rows,'accepted':m[S+76],'payload_length':m[S+1104],'requests':requests,'execution':{k:e[k] for k in ['stop','trace_length','trace_sha256']}}
scripts/test_qvm_scoreboard_rows.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,math,unittest
2
+ from pathlib import Path
3
+ from qvm_scoreboard_body_support import DEFAULT
4
+
5
+ def signed(v):return (v+2**31)%2**32-2**31
6
+
7
+ def project(c,id,now):
8
+ d={str(k):v for k,v in DEFAULT.items()};d.update(c);v=lambda o:signed(d[str(o)]);ping=999 if v(468)==1 else min(v(452),999);cache=v(6160)
9
+ if v(4324) and v(12)&1024:ping=cache
10
+ else:cache=ping
11
+ if d.get('flags',0)&8:ping=-1
12
+ status=2 if v(3740) else 1 if v(4324) or v(208)<=0 or v(220)&16384 else 0
13
+ return cache&0xffffffff,[id,v(248),ping,math.trunc(signed(signed(now-v(576))+v(4336))/60000),status,v(280),v(3692),d['300']&255,v(300)>>8,v(308),v(3032),v(696)]
14
+ class ScoreboardRowTests(unittest.TestCase):
15
+ @classmethod
16
+ def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-scoreboard-rows.json').read_text())['probes']
17
+ def test_independent_rows_caches_and_pre_rejection_mutations(self):
18
+ self.assertEqual(len(self.ps),76)
19
+ for p in self.ps:
20
+ cache=[c.get('6160',77)&0xffffffff for c in p['clients']];rows=[];total=0;accepted=0
21
+ for j,c in enumerate(p['clients']):
22
+ cache[j],numbers=project(c,j,p['now']);rows.append({'numbers':numbers,'format':79328})
23
+ if total+p['lengths'][j]>1024:break
24
+ total+=p['lengths'][j];accepted+=1
25
+ self.assertEqual(p['rows'],rows);self.assertEqual(p['final_cache'],cache);self.assertEqual((p['accepted'],p['payload_length']),(accepted,total));self.assertEqual(p['execution']['stop'],179734)
26
+ def test_header_abi_and_recipient(self):
27
+ for p in self.ps:
28
+ a=p['requests'][0]['arguments'];self.assertEqual({k:a[k] for k in ['8','12','16','20']},{'8':79310,'12':p['accepted'],'16':2,'20':1});self.assertEqual(p['requests'][-1]['arguments']['8'],3)
29
+ def test_unclamped_class_and_nonconnecting_ping_difference_is_exercised(self):
30
+ self.assertTrue(any(p['rows'] and p['rows'][0]['numbers'][-1]==21 for p in self.ps));self.assertTrue(any(c.get('468')==0 and p['rows'][0]['numbers'][2]==-5 for p in self.ps for c in p['clients']))
31
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -1903,3 +1903,8 @@ edge docs/research/qvm-string-memory.json scripts/test_qvm_string_memory.py
1903
  group string-memory scripts/analyze_qvm_string_memory.py
1904
  edge scripts/analyze_qvm_string_memory.py scripts/analyze_qvm_resumer_audit.py
1905
  edge scripts/qvm_string_memory_support.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
1903
  group string-memory scripts/analyze_qvm_string_memory.py
1904
  edge scripts/analyze_qvm_string_memory.py scripts/analyze_qvm_resumer_audit.py
1905
  edge scripts/qvm_string_memory_support.py scripts/analyze_qvm_resumer_audit.py
1906
+ report scripts/analyze_qvm_scoreboard_rows.py docs/research/qvm-scoreboard-rows.json
1907
+ edge docs/research/qvm-scoreboard-rows.json scripts/test_qvm_scoreboard_rows.py
1908
+ group scoreboard-rows scripts/analyze_qvm_scoreboard_rows.py
1909
+ edge scripts/analyze_qvm_scoreboard_rows.py scripts/analyze_qvm_resumer_audit.py
1910
+ edge scripts/qvm_scoreboard_body_support.py scripts/analyze_qvm_resumer_audit.py