qvm: free to allocator lifecycle
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_FREE_REALLOCATE.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-free-reallocate.json +0 -0
- scripts/analyze_qvm_free_reallocate.py +21 -0
- scripts/test_qvm_free_reallocate.py +21 -0
docs/ASSET_PIPELINE_TODO.md
CHANGED
|
@@ -703,3 +703,6 @@ Research progress: RE-675 [report](research/QVM_WORD_STRLEN.md); remaining nativ
|
|
| 703 |
|
| 704 |
|
| 705 |
Research progress: RE-676 [report](research/QVM_STRING_RELEASE.md); remaining native/content/runtime/platform scope stays open.
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
|
| 704 |
|
| 705 |
Research progress: RE-676 [report](research/QVM_STRING_RELEASE.md); remaining native/content/runtime/platform scope stays open.
|
| 706 |
+
|
| 707 |
+
|
| 708 |
+
Research progress: RE-677 [report](research/QVM_FREE_REALLOCATE.md); remaining native/content/runtime/platform scope stays open.
|
docs/FINDINGS.md
CHANGED
|
@@ -1049,3 +1049,6 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
|
|
| 1049 |
|
| 1050 |
|
| 1051 |
**RE-676 — String resource list detach and bounded byte wipe:** 249639 searches the resource list, detaches a matching header, runs actual36038, wipes length+8 bytes and requests16934 heap release; missing pointers do nothing. [Evidence](research/QVM_STRING_RELEASE.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1049 |
|
| 1050 |
|
| 1051 |
**RE-676 — String resource list detach and bounded byte wipe:** 249639 searches the resource list, detaches a matching header, runs actual36038, wipes length+8 bytes and requests16934 heap release; missing pointers do nothing. [Evidence](research/QVM_STRING_RELEASE.md).
|
| 1052 |
+
|
| 1053 |
+
|
| 1054 |
+
**RE-677 — Actual entity free through allocator reuse timing:** Actual277400 free-time and used state now feed277165 reuse policy; age1000 is eligible, and start+2000 can permit immediate reuse. [Evidence](research/QVM_FREE_REALLOCATE.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1029,3 +1029,6 @@ Research progress: RE-675 [report](research/QVM_WORD_STRLEN.md); remaining nativ
|
|
| 1029 |
|
| 1030 |
|
| 1031 |
Research progress: RE-676 [report](research/QVM_STRING_RELEASE.md); remaining native/content/runtime/platform scope stays open.
|
|
|
|
|
|
|
|
|
|
|
|
| 1029 |
|
| 1030 |
|
| 1031 |
Research progress: RE-676 [report](research/QVM_STRING_RELEASE.md); remaining native/content/runtime/platform scope stays open.
|
| 1032 |
+
|
| 1033 |
+
|
| 1034 |
+
Research progress: RE-677 [report](research/QVM_FREE_REALLOCATE.md); remaining native/content/runtime/platform scope stays open.
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -1037,3 +1037,8 @@ Complete36038 tests each byte of packed words and returns the first NUL offset,
|
|
| 1037 |
## 2026-10-21 — RE-676 String resource list detach and bounded byte wipe (separate task commit)
|
| 1038 |
|
| 1039 |
249639 searches the resource list, detaches a matching header, runs actual36038, wipes length+8 bytes and requests16934 heap release; missing pointers do nothing. 28 whole-byte fixtures independently verify head/middle/tail/only/missing detach, pointer rewiring, unaligned wipe ends and exact child ordering. Full suite: 1165 tests pass. Report regenerates byte-identically (91672 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1037 |
## 2026-10-21 — RE-676 String resource list detach and bounded byte wipe (separate task commit)
|
| 1038 |
|
| 1039 |
249639 searches the resource list, detaches a matching header, runs actual36038, wipes length+8 bytes and requests16934 heap release; missing pointers do nothing. 28 whole-byte fixtures independently verify head/middle/tail/only/missing detach, pointer rewiring, unaligned wipe ends and exact child ordering. Full suite: 1165 tests pass. Report regenerates byte-identically (91672 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
|
| 1040 |
+
|
| 1041 |
+
|
| 1042 |
+
## 2026-10-21 — RE-677 Actual entity free through allocator reuse timing (separate task commit)
|
| 1043 |
+
|
| 1044 |
+
Actual277400 free-time and used state now feed277165 reuse policy; age1000 is eligible, and start+2000 can permit immediate reuse. 16 full-record compositions independently check free/reuse/extension across protected records, start offsets and ages0/999/1000/1001. Full suite: 1169 tests pass. Report regenerates byte-identically (782381 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
|
docs/REVERSE_ENGINEERING_TODO.md
CHANGED
|
@@ -1072,3 +1072,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1072 |
|
| 1073 |
|
| 1074 |
- [x] RE-676 String resource list detach and bounded byte wipe ([report](research/QVM_STRING_RELEASE.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1072 |
|
| 1073 |
|
| 1074 |
- [x] RE-676 String resource list detach and bounded byte wipe ([report](research/QVM_STRING_RELEASE.md)).
|
| 1075 |
+
|
| 1076 |
+
|
| 1077 |
+
- [x] RE-677 Actual entity free through allocator reuse timing ([report](research/QVM_FREE_REALLOCATE.md)).
|
docs/research/QVM_FREE_REALLOCATE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Actual entity free through allocator reuse timing
|
| 2 |
+
|
| 3 |
+
RE-677. Reproduce with `python3 scripts/analyze_qvm_free_reallocate.py`; check with `python3 scripts/test_qvm_free_reallocate.py`. The [machine report](qvm-free-reallocate.json) retains source identity and bounded fixtures.
|
| 4 |
+
|
| 5 |
+
The composition frees actual slot64, advances only the explicit fixture clock and runs the recovered allocator/initializer. An unprotected slot is reusable when free time≤start+2000 or age≥1000; protected slots retain used532 and force extension. Whole selected/unselected880-byte records are independently checked, confirming initializer updates only its known five fields rather than clearing the record again. Native registration occurs only on extension and unlink remains captured. These fixture clocks test the producer/consumer contract, not recovered live server timing or native engine effects.
|
| 6 |
+
|
| 7 |
+
No original executable/full QVM/native collision/physics/rendering executes. Native responses and legal input domains are supplied or unverified where stated; full runtime/macOS/Linux Rust/Bevy/Solari gameplay remains open.
|
docs/research/README.md
CHANGED
|
@@ -630,3 +630,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 630 |
|
| 631 |
|
| 632 |
[RE-676: String resource list detach and bounded byte wipe](QVM_STRING_RELEASE.md). Reproduce with `python3 scripts/analyze_qvm_string_release.py`; check with `python3 scripts/test_qvm_string_release.py`.
|
|
|
|
|
|
|
|
|
|
|
|
| 630 |
|
| 631 |
|
| 632 |
[RE-676: String resource list detach and bounded byte wipe](QVM_STRING_RELEASE.md). Reproduce with `python3 scripts/analyze_qvm_string_release.py`; check with `python3 scripts/test_qvm_string_release.py`.
|
| 633 |
+
|
| 634 |
+
|
| 635 |
+
[RE-677: Actual entity free through allocator reuse timing](QVM_FREE_REALLOCATE.md). Reproduce with `python3 scripts/analyze_qvm_free_reallocate.py`; check with `python3 scripts/test_qvm_free_reallocate.py`.
|
docs/research/qvm-free-reallocate.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_free_reallocate.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Actual277400 free state consumed by actual277165 allocator timing policy."""
|
| 3 |
+
import itertools
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from qvm_research_support import source
|
| 6 |
+
from analyze_qvm_allocated_event import setup
|
| 7 |
+
from analyze_qvm_entity_free import release,FIELDS
|
| 8 |
+
from analyze_qvm_entity_allocate import allocate
|
| 9 |
+
from analyze_qvm_entity_init import POOL,STRIDE
|
| 10 |
+
from analyze_qvm_temp_event import record
|
| 11 |
+
from analyze_qvm import write_json
|
| 12 |
+
|
| 13 |
+
def main():
|
| 14 |
+
q,raw,h,ins=source();rows=[];freed=POOL+64*STRIDE;extension=freed+STRIDE
|
| 15 |
+
for protected,start,gap in itertools.product([0,1],[0,3000],[0,999,1000,1001]):
|
| 16 |
+
m=setup(raw,h,True);m[34992532]=5000;m[34992544]=start;m[freed+532]=1;m[freed+548]=protected;m[freed+528]=0
|
| 17 |
+
for o in FIELDS:m[freed+o]=0
|
| 18 |
+
extra_before=record(m,extension);m,freer=release(ins,m,freed);m[34992532]=5000+gap;m,alloc=allocate(ins,m)
|
| 19 |
+
rows.append({'protected':protected,'start':start,'gap':gap,'free':freer,'allocation':alloc,'extension_initial':extra_before,'final_freed_record':record(m,freed),'final_extension_record':record(m,extension)})
|
| 20 |
+
write_json(Path('docs/research/qvm-free-reallocate.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual277400 then277165/277125 on explicit clocks/pool. Unlink/registration requests captured, zero fill modeled. No original heap resources or server schedule/native world effects.'})
|
| 21 |
+
if __name__=='__main__':main()
|
scripts/test_qvm_free_reallocate.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
FREE=34091368+64*880
|
| 4 |
+
class FreeReallocateTests(unittest.TestCase):
|
| 5 |
+
@classmethod
|
| 6 |
+
def setUpClass(cls):cls.rows=json.loads(Path('docs/research/qvm-free-reallocate.json').read_text())['probes']
|
| 7 |
+
def test_independent_free_age_and_start_policy(self):
|
| 8 |
+
self.assertEqual(len(self.rows),16)
|
| 9 |
+
for p in self.rows:
|
| 10 |
+
reuse=not p['protected'] and (5000<=p['start']+2000 or p['gap']>=1000);a=p['allocation'];self.assertEqual(a['selected'],FREE if reuse else FREE+880);self.assertEqual(a['count'],65 if reuse else 66)
|
| 11 |
+
def test_full_selected_record_and_unselected_preservation(self):
|
| 12 |
+
for p in self.rows:
|
| 13 |
+
reused=p['allocation']['selected']==FREE;expected=(p['free']['final_record'] if reused else p['extension_initial']).copy();expected.update({'0':64 if reused else 65,'532':1,'536':97243,'540':(-1068468807)&0xffffffff,'512':1023});self.assertEqual(p['allocation']['record'],expected)
|
| 14 |
+
self.assertEqual(p['final_freed_record'],expected if reused else p['free']['final_record']);self.assertEqual(p['final_extension_record'],p['extension_initial'] if reused else expected)
|
| 15 |
+
def test_exact_age_boundary_and_protected_paths(self):
|
| 16 |
+
for p in self.rows:
|
| 17 |
+
if p['start']==0 and not p['protected']:self.assertEqual(p['allocation']['selected']==FREE,p['gap']>=1000)
|
| 18 |
+
if p['protected']:self.assertEqual(p['allocation']['selected'],FREE+880)
|
| 19 |
+
def test_native_registration_only_for_extension(self):
|
| 20 |
+
for p in self.rows:self.assertEqual(len(p['allocation']['registrations']),int(p['allocation']['selected']!=FREE));self.assertEqual(p['free']['requests'][0]['target'],-32)
|
| 21 |
+
if __name__=='__main__':unittest.main()
|