qvm: recover saved-position load and close branches
Browse files- 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_POSITION_LOAD.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-position-load.json +0 -0
- docs/research/qvm-position-save.json +120 -0
- docs/research/rust-position-save.json +1 -1
- scripts/analyze_qvm_position_load.py +21 -0
- scripts/qvm_persistence_support.py +20 -2
- scripts/test_qvm_position_load.py +19 -0
- xtask/checks.tsv +6 -0
docs/FINDINGS.md
CHANGED
|
@@ -1697,3 +1697,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
|
|
| 1697 |
|
| 1698 |
|
| 1699 |
**RE-899:** Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. [Evidence](research/RUST_POSITION_SAVE.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1697 |
|
| 1698 |
|
| 1699 |
**RE-899:** Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. [Evidence](research/RUST_POSITION_SAVE.md).
|
| 1700 |
+
|
| 1701 |
+
|
| 1702 |
+
**RE-900:** 96 actual246554 cases execute70503,70458/37914 and38326/38355/36779. A nonzero handle and signed length>0 with unsigned length<1023 permit reading. Exactly6 scanner assignments replace all position/angle words; malformed or truncated input preserves the original six words. Successful read paths close even after scan failure; zero/negative/oversized lengths return without a close in this body. Native file buffers/handles and real engine ownership remain supplied/captured. [Evidence](research/QVM_POSITION_LOAD.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1731,3 +1731,6 @@ RE-898: 96 actual246746 cases execute70503/69386/36038,70458/37914,70386 and flo
|
|
| 1731 |
|
| 1732 |
|
| 1733 |
RE-899: Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. Full runtime completion remains open. [Evidence](research/RUST_POSITION_SAVE.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1731 |
|
| 1732 |
|
| 1733 |
RE-899: Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. Full runtime completion remains open. [Evidence](research/RUST_POSITION_SAVE.md).
|
| 1734 |
+
|
| 1735 |
+
|
| 1736 |
+
RE-900: 96 actual246554 cases execute70503,70458/37914 and38326/38355/36779. A nonzero handle and signed length>0 with unsigned length<1023 permit reading. Exactly6 scanner assignments replace all position/angle words; malformed or truncated input preserves the original six words. Successful read paths close even after scan failure; zero/negative/oversized lengths return without a close in this body. Native file buffers/handles and real engine ownership remain supplied/captured. Full runtime completion remains open. [Evidence](research/QVM_POSITION_LOAD.md).
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -2210,3 +2210,8 @@ Rust matches72 actual38326/38355/37159/36779 cases, preserving digits-only integ
|
|
| 2210 |
## 2026-10-28 — RE-899 Rust saved-position write and handle intentions
|
| 2211 |
|
| 2212 |
Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. Focused `cargo xtask test-group rust-position-save` passes (9 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2210 |
## 2026-10-28 — RE-899 Rust saved-position write and handle intentions
|
| 2211 |
|
| 2212 |
Rust matches96 original246746 cases with recovered userinfo, path construction and floating formatter bytes. Mode/enabled/position gates,63-byte map truncation, unsanitized GUID path bytes, ignored open return and write/close ordering are preserved. Typed unsupported format errors preserve the selector. Engine userinfo, native files and unsafe paths/ABI ownership remain open. Focused `cargo xtask test-group rust-position-save` passes (9 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.
|
| 2213 |
+
|
| 2214 |
+
|
| 2215 |
+
## 2026-10-28 — RE-900 Original saved-position read and all-six assignment gate
|
| 2216 |
+
|
| 2217 |
+
96 actual246554 cases execute70503,70458/37914 and38326/38355/36779. A nonzero handle and signed length>0 with unsigned length<1023 permit reading. Exactly6 scanner assignments replace all position/angle words; malformed or truncated input preserves the original six words. Successful read paths close even after scan failure; zero/negative/oversized lengths return without a close in this body. Native file buffers/handles and real engine ownership remain supplied/captured. Focused `cargo xtask test-group qvm-position-load` passes (7 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
|
@@ -1768,3 +1768,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1768 |
|
| 1769 |
|
| 1770 |
- [x] RE-899 Rust saved-position write and handle intentions ([evidence](research/RUST_POSITION_SAVE.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1768 |
|
| 1769 |
|
| 1770 |
- [x] RE-899 Rust saved-position write and handle intentions ([evidence](research/RUST_POSITION_SAVE.md)).
|
| 1771 |
+
|
| 1772 |
+
|
| 1773 |
+
- [x] RE-900 Original saved-position read and all-six assignment gate ([evidence](research/QVM_POSITION_LOAD.md)).
|
docs/research/QVM_POSITION_LOAD.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Original saved-position read and all-six assignment gate
|
| 2 |
+
|
| 3 |
+
RE-900. Reproduce with `python3 scripts/analyze_qvm_position_load.py`; focused validation: `cargo xtask test-group qvm-position-load`. [Machine report](qvm-position-load.json).
|
| 4 |
+
|
| 5 |
+
96 actual246554 cases execute70503,70458/37914 and38326/38355/36779. A nonzero handle and signed length>0 with unsigned length<1023 permit reading. Exactly6 scanner assignments replace all position/angle words; malformed or truncated input preserves the original six words. Successful read paths close even after scan failure; zero/negative/oversized lengths return without a close in this body. Native file buffers/handles and real engine ownership remain supplied/captured.
|
| 6 |
+
|
| 7 |
+
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
|
docs/research/README.md
CHANGED
|
@@ -1303,3 +1303,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 1303 |
|
| 1304 |
|
| 1305 |
[RE-899: Rust saved-position write and handle intentions](RUST_POSITION_SAVE.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1303 |
|
| 1304 |
|
| 1305 |
[RE-899: Rust saved-position write and handle intentions](RUST_POSITION_SAVE.md).
|
| 1306 |
+
|
| 1307 |
+
|
| 1308 |
+
[RE-900: Original saved-position read and all-six assignment gate](QVM_POSITION_LOAD.md).
|
docs/research/qvm-position-load.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
docs/research/qvm-position-save.json
CHANGED
|
@@ -1683,6 +1683,11 @@
|
|
| 1683 |
"address": 23712,
|
| 1684 |
"after": 1,
|
| 1685 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1686 |
}
|
| 1687 |
],
|
| 1688 |
"children": [
|
|
@@ -1730,6 +1735,11 @@
|
|
| 1730 |
"address": 23712,
|
| 1731 |
"after": 1,
|
| 1732 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1733 |
}
|
| 1734 |
],
|
| 1735 |
"children": [
|
|
@@ -1777,6 +1787,11 @@
|
|
| 1777 |
"address": 23712,
|
| 1778 |
"after": 1,
|
| 1779 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1780 |
}
|
| 1781 |
],
|
| 1782 |
"children": [
|
|
@@ -1824,6 +1839,11 @@
|
|
| 1824 |
"address": 23712,
|
| 1825 |
"after": 1,
|
| 1826 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1827 |
}
|
| 1828 |
],
|
| 1829 |
"children": [
|
|
@@ -2059,6 +2079,11 @@
|
|
| 2059 |
"address": 23712,
|
| 2060 |
"after": 1,
|
| 2061 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2062 |
}
|
| 2063 |
],
|
| 2064 |
"children": [
|
|
@@ -2106,6 +2131,11 @@
|
|
| 2106 |
"address": 23712,
|
| 2107 |
"after": 1,
|
| 2108 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2109 |
}
|
| 2110 |
],
|
| 2111 |
"children": [
|
|
@@ -2153,6 +2183,11 @@
|
|
| 2153 |
"address": 23712,
|
| 2154 |
"after": 1,
|
| 2155 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2156 |
}
|
| 2157 |
],
|
| 2158 |
"children": [
|
|
@@ -2200,6 +2235,11 @@
|
|
| 2200 |
"address": 23712,
|
| 2201 |
"after": 1,
|
| 2202 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2203 |
}
|
| 2204 |
],
|
| 2205 |
"children": [
|
|
@@ -2435,6 +2475,11 @@
|
|
| 2435 |
"address": 23712,
|
| 2436 |
"after": 1,
|
| 2437 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2438 |
}
|
| 2439 |
],
|
| 2440 |
"children": [
|
|
@@ -2482,6 +2527,11 @@
|
|
| 2482 |
"address": 23712,
|
| 2483 |
"after": 1,
|
| 2484 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2485 |
}
|
| 2486 |
],
|
| 2487 |
"children": [
|
|
@@ -2529,6 +2579,11 @@
|
|
| 2529 |
"address": 23712,
|
| 2530 |
"after": 1,
|
| 2531 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2532 |
}
|
| 2533 |
],
|
| 2534 |
"children": [
|
|
@@ -2576,6 +2631,11 @@
|
|
| 2576 |
"address": 23712,
|
| 2577 |
"after": 1,
|
| 2578 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2579 |
}
|
| 2580 |
],
|
| 2581 |
"children": [
|
|
@@ -2811,6 +2871,11 @@
|
|
| 2811 |
"address": 23712,
|
| 2812 |
"after": 1,
|
| 2813 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2814 |
}
|
| 2815 |
],
|
| 2816 |
"children": [
|
|
@@ -2858,6 +2923,11 @@
|
|
| 2858 |
"address": 23712,
|
| 2859 |
"after": 1,
|
| 2860 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2861 |
}
|
| 2862 |
],
|
| 2863 |
"children": [
|
|
@@ -2905,6 +2975,11 @@
|
|
| 2905 |
"address": 23712,
|
| 2906 |
"after": 1,
|
| 2907 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2908 |
}
|
| 2909 |
],
|
| 2910 |
"children": [
|
|
@@ -2952,6 +3027,11 @@
|
|
| 2952 |
"address": 23712,
|
| 2953 |
"after": 1,
|
| 2954 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2955 |
}
|
| 2956 |
],
|
| 2957 |
"children": [
|
|
@@ -3192,6 +3272,11 @@
|
|
| 3192 |
"address": 23712,
|
| 3193 |
"after": 1,
|
| 3194 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3195 |
}
|
| 3196 |
],
|
| 3197 |
"children": [
|
|
@@ -3252,6 +3337,11 @@
|
|
| 3252 |
"address": 23712,
|
| 3253 |
"after": 1,
|
| 3254 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3255 |
}
|
| 3256 |
],
|
| 3257 |
"children": [
|
|
@@ -3312,6 +3402,11 @@
|
|
| 3312 |
"address": 23712,
|
| 3313 |
"after": 1,
|
| 3314 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3315 |
}
|
| 3316 |
],
|
| 3317 |
"children": [
|
|
@@ -3386,6 +3481,11 @@
|
|
| 3386 |
"address": 23712,
|
| 3387 |
"after": 1,
|
| 3388 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3389 |
}
|
| 3390 |
],
|
| 3391 |
"children": [
|
|
@@ -3643,6 +3743,11 @@
|
|
| 3643 |
"address": 23712,
|
| 3644 |
"after": 1,
|
| 3645 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3646 |
}
|
| 3647 |
],
|
| 3648 |
"children": [
|
|
@@ -3690,6 +3795,11 @@
|
|
| 3690 |
"address": 23712,
|
| 3691 |
"after": 1,
|
| 3692 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3693 |
}
|
| 3694 |
],
|
| 3695 |
"children": [
|
|
@@ -3737,6 +3847,11 @@
|
|
| 3737 |
"address": 23712,
|
| 3738 |
"after": 1,
|
| 3739 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3740 |
}
|
| 3741 |
],
|
| 3742 |
"children": [
|
|
@@ -3784,6 +3899,11 @@
|
|
| 3784 |
"address": 23712,
|
| 3785 |
"after": 1,
|
| 3786 |
"before": 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3787 |
}
|
| 3788 |
],
|
| 3789 |
"children": [
|
|
|
|
| 1683 |
"address": 23712,
|
| 1684 |
"after": 1,
|
| 1685 |
"before": 0
|
| 1686 |
+
},
|
| 1687 |
+
{
|
| 1688 |
+
"address": 35104424,
|
| 1689 |
+
"after": 7942008,
|
| 1690 |
+
"before": 0
|
| 1691 |
}
|
| 1692 |
],
|
| 1693 |
"children": [
|
|
|
|
| 1735 |
"address": 23712,
|
| 1736 |
"after": 1,
|
| 1737 |
"before": 0
|
| 1738 |
+
},
|
| 1739 |
+
{
|
| 1740 |
+
"address": 35104424,
|
| 1741 |
+
"after": 7942008,
|
| 1742 |
+
"before": 0
|
| 1743 |
}
|
| 1744 |
],
|
| 1745 |
"children": [
|
|
|
|
| 1787 |
"address": 23712,
|
| 1788 |
"after": 1,
|
| 1789 |
"before": 0
|
| 1790 |
+
},
|
| 1791 |
+
{
|
| 1792 |
+
"address": 35104424,
|
| 1793 |
+
"after": 7942008,
|
| 1794 |
+
"before": 0
|
| 1795 |
}
|
| 1796 |
],
|
| 1797 |
"children": [
|
|
|
|
| 1839 |
"address": 23712,
|
| 1840 |
"after": 1,
|
| 1841 |
"before": 0
|
| 1842 |
+
},
|
| 1843 |
+
{
|
| 1844 |
+
"address": 35104424,
|
| 1845 |
+
"after": 7942008,
|
| 1846 |
+
"before": 0
|
| 1847 |
}
|
| 1848 |
],
|
| 1849 |
"children": [
|
|
|
|
| 2079 |
"address": 23712,
|
| 2080 |
"after": 1,
|
| 2081 |
"before": 0
|
| 2082 |
+
},
|
| 2083 |
+
{
|
| 2084 |
+
"address": 35104424,
|
| 2085 |
+
"after": 7942008,
|
| 2086 |
+
"before": 0
|
| 2087 |
}
|
| 2088 |
],
|
| 2089 |
"children": [
|
|
|
|
| 2131 |
"address": 23712,
|
| 2132 |
"after": 1,
|
| 2133 |
"before": 0
|
| 2134 |
+
},
|
| 2135 |
+
{
|
| 2136 |
+
"address": 35104424,
|
| 2137 |
+
"after": 7942008,
|
| 2138 |
+
"before": 0
|
| 2139 |
}
|
| 2140 |
],
|
| 2141 |
"children": [
|
|
|
|
| 2183 |
"address": 23712,
|
| 2184 |
"after": 1,
|
| 2185 |
"before": 0
|
| 2186 |
+
},
|
| 2187 |
+
{
|
| 2188 |
+
"address": 35104424,
|
| 2189 |
+
"after": 7942008,
|
| 2190 |
+
"before": 0
|
| 2191 |
}
|
| 2192 |
],
|
| 2193 |
"children": [
|
|
|
|
| 2235 |
"address": 23712,
|
| 2236 |
"after": 1,
|
| 2237 |
"before": 0
|
| 2238 |
+
},
|
| 2239 |
+
{
|
| 2240 |
+
"address": 35104424,
|
| 2241 |
+
"after": 7942008,
|
| 2242 |
+
"before": 0
|
| 2243 |
}
|
| 2244 |
],
|
| 2245 |
"children": [
|
|
|
|
| 2475 |
"address": 23712,
|
| 2476 |
"after": 1,
|
| 2477 |
"before": 0
|
| 2478 |
+
},
|
| 2479 |
+
{
|
| 2480 |
+
"address": 35104424,
|
| 2481 |
+
"after": 7942008,
|
| 2482 |
+
"before": 0
|
| 2483 |
}
|
| 2484 |
],
|
| 2485 |
"children": [
|
|
|
|
| 2527 |
"address": 23712,
|
| 2528 |
"after": 1,
|
| 2529 |
"before": 0
|
| 2530 |
+
},
|
| 2531 |
+
{
|
| 2532 |
+
"address": 35104424,
|
| 2533 |
+
"after": 7942008,
|
| 2534 |
+
"before": 0
|
| 2535 |
}
|
| 2536 |
],
|
| 2537 |
"children": [
|
|
|
|
| 2579 |
"address": 23712,
|
| 2580 |
"after": 1,
|
| 2581 |
"before": 0
|
| 2582 |
+
},
|
| 2583 |
+
{
|
| 2584 |
+
"address": 35104424,
|
| 2585 |
+
"after": 7942008,
|
| 2586 |
+
"before": 0
|
| 2587 |
}
|
| 2588 |
],
|
| 2589 |
"children": [
|
|
|
|
| 2631 |
"address": 23712,
|
| 2632 |
"after": 1,
|
| 2633 |
"before": 0
|
| 2634 |
+
},
|
| 2635 |
+
{
|
| 2636 |
+
"address": 35104424,
|
| 2637 |
+
"after": 7942008,
|
| 2638 |
+
"before": 0
|
| 2639 |
}
|
| 2640 |
],
|
| 2641 |
"children": [
|
|
|
|
| 2871 |
"address": 23712,
|
| 2872 |
"after": 1,
|
| 2873 |
"before": 0
|
| 2874 |
+
},
|
| 2875 |
+
{
|
| 2876 |
+
"address": 35104424,
|
| 2877 |
+
"after": 7942008,
|
| 2878 |
+
"before": 0
|
| 2879 |
}
|
| 2880 |
],
|
| 2881 |
"children": [
|
|
|
|
| 2923 |
"address": 23712,
|
| 2924 |
"after": 1,
|
| 2925 |
"before": 0
|
| 2926 |
+
},
|
| 2927 |
+
{
|
| 2928 |
+
"address": 35104424,
|
| 2929 |
+
"after": 7942008,
|
| 2930 |
+
"before": 0
|
| 2931 |
}
|
| 2932 |
],
|
| 2933 |
"children": [
|
|
|
|
| 2975 |
"address": 23712,
|
| 2976 |
"after": 1,
|
| 2977 |
"before": 0
|
| 2978 |
+
},
|
| 2979 |
+
{
|
| 2980 |
+
"address": 35104424,
|
| 2981 |
+
"after": 7942008,
|
| 2982 |
+
"before": 0
|
| 2983 |
}
|
| 2984 |
],
|
| 2985 |
"children": [
|
|
|
|
| 3027 |
"address": 23712,
|
| 3028 |
"after": 1,
|
| 3029 |
"before": 0
|
| 3030 |
+
},
|
| 3031 |
+
{
|
| 3032 |
+
"address": 35104424,
|
| 3033 |
+
"after": 7942008,
|
| 3034 |
+
"before": 0
|
| 3035 |
}
|
| 3036 |
],
|
| 3037 |
"children": [
|
|
|
|
| 3272 |
"address": 23712,
|
| 3273 |
"after": 1,
|
| 3274 |
"before": 0
|
| 3275 |
+
},
|
| 3276 |
+
{
|
| 3277 |
+
"address": 35104424,
|
| 3278 |
+
"after": 7942008,
|
| 3279 |
+
"before": 0
|
| 3280 |
}
|
| 3281 |
],
|
| 3282 |
"children": [
|
|
|
|
| 3337 |
"address": 23712,
|
| 3338 |
"after": 1,
|
| 3339 |
"before": 0
|
| 3340 |
+
},
|
| 3341 |
+
{
|
| 3342 |
+
"address": 35104424,
|
| 3343 |
+
"after": 7942008,
|
| 3344 |
+
"before": 0
|
| 3345 |
}
|
| 3346 |
],
|
| 3347 |
"children": [
|
|
|
|
| 3402 |
"address": 23712,
|
| 3403 |
"after": 1,
|
| 3404 |
"before": 0
|
| 3405 |
+
},
|
| 3406 |
+
{
|
| 3407 |
+
"address": 35104424,
|
| 3408 |
+
"after": 7942008,
|
| 3409 |
+
"before": 0
|
| 3410 |
}
|
| 3411 |
],
|
| 3412 |
"children": [
|
|
|
|
| 3481 |
"address": 23712,
|
| 3482 |
"after": 1,
|
| 3483 |
"before": 0
|
| 3484 |
+
},
|
| 3485 |
+
{
|
| 3486 |
+
"address": 35104424,
|
| 3487 |
+
"after": 7942008,
|
| 3488 |
+
"before": 0
|
| 3489 |
}
|
| 3490 |
],
|
| 3491 |
"children": [
|
|
|
|
| 3743 |
"address": 23712,
|
| 3744 |
"after": 1,
|
| 3745 |
"before": 0
|
| 3746 |
+
},
|
| 3747 |
+
{
|
| 3748 |
+
"address": 35104424,
|
| 3749 |
+
"after": 7942008,
|
| 3750 |
+
"before": 0
|
| 3751 |
}
|
| 3752 |
],
|
| 3753 |
"children": [
|
|
|
|
| 3795 |
"address": 23712,
|
| 3796 |
"after": 1,
|
| 3797 |
"before": 0
|
| 3798 |
+
},
|
| 3799 |
+
{
|
| 3800 |
+
"address": 35104424,
|
| 3801 |
+
"after": 7942008,
|
| 3802 |
+
"before": 0
|
| 3803 |
}
|
| 3804 |
],
|
| 3805 |
"children": [
|
|
|
|
| 3847 |
"address": 23712,
|
| 3848 |
"after": 1,
|
| 3849 |
"before": 0
|
| 3850 |
+
},
|
| 3851 |
+
{
|
| 3852 |
+
"address": 35104424,
|
| 3853 |
+
"after": 7942008,
|
| 3854 |
+
"before": 0
|
| 3855 |
}
|
| 3856 |
],
|
| 3857 |
"children": [
|
|
|
|
| 3899 |
"address": 23712,
|
| 3900 |
"after": 1,
|
| 3901 |
"before": 0
|
| 3902 |
+
},
|
| 3903 |
+
{
|
| 3904 |
+
"address": 35104424,
|
| 3905 |
+
"after": 7942008,
|
| 3906 |
+
"before": 0
|
| 3907 |
}
|
| 3908 |
],
|
| 3909 |
"children": [
|
docs/research/rust-position-save.json
CHANGED
|
@@ -1739,5 +1739,5 @@
|
|
| 1739 |
}
|
| 1740 |
],
|
| 1741 |
"source_report": "docs/research/qvm-position-save.json",
|
| 1742 |
-
"source_report_sha256": "
|
| 1743 |
}
|
|
|
|
| 1739 |
}
|
| 1740 |
],
|
| 1741 |
"source_report": "docs/research/qvm-position-save.json",
|
| 1742 |
+
"source_report_sha256": "ccf26cb6451ead039a031bfbe2cbf48c9d26880043aece2968d998fab7c89014"
|
| 1743 |
}
|
scripts/analyze_qvm_position_load.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Execute the verified original QVM body; native effects are supplied or captured."""
|
| 3 |
+
import itertools
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from qvm_research_support import source,constants
|
| 6 |
+
from qvm_camera_world_support import B,run
|
| 7 |
+
from qvm_exit_rules_support import POOL,CPOOL
|
| 8 |
+
from analyze_qvm_acceleration import word,number
|
| 9 |
+
from analyze_qvm import write_json
|
| 10 |
+
|
| 11 |
+
def main():
|
| 12 |
+
q,raw,h,ins=source();rows=[]
|
| 13 |
+
from qvm_persistence_support import environment,load_position
|
| 14 |
+
from qvm_exit_rules_support import CPOOL
|
| 15 |
+
for mode,enabled,handle,length,valid in itertools.product([0,9],[0,1],[0,7],[-1,0,1,31,1022,1023],[False,True]):
|
| 16 |
+
data=b'1.25,-2.5,3,90,180,-45.5\nname' if valid else b'1.0,2.0,x,90,180,0';m,b=environment(raw,h);m.update({34090788:mode,34064148:enabled});pointer=CPOOL+6336*3;values=[word(77+j) for j in range(6)]
|
| 17 |
+
for j,value in enumerate(values):m[pointer+3716+4*j]=value
|
| 18 |
+
m,p,b=load_position(ins,m,b,pointer,b'\\cl_guid\\ID',b'ut4_test',handle,length,data);p.update(input=dict(mode=mode,enabled=enabled,slot=3,handle=handle,length=length,data=data.hex(),values=values),values=[m[pointer+3716+4*j]&0xffffffff for j in range(6)],ring=m[23708]&0xffffffff,info_ring=m[23712]&0xffffffff);rows.append(p)
|
| 19 |
+
|
| 20 |
+
write_json(Path('docs/research/qvm-position-load.json'),{'source':q['source'],'sha256':q['sha256'],'root':246554,'probes':rows,'limits':'96 actual246554 cases execute70503,70458/37914 and38326/38355/36779. A nonzero handle and signed length>0 with unsigned length<1023 permit reading. Exactly6 scanner assignments replace all position/angle words; malformed or truncated input preserves the original six words. Successful read paths close even after scan failure; zero/negative/oversized lengths return without a close in this body. Native file buffers/handles and real engine ownership remain supplied/captured.'})
|
| 21 |
+
if __name__=='__main__':main()
|
scripts/qvm_persistence_support.py
CHANGED
|
@@ -29,7 +29,7 @@ def environment(raw,h):
|
|
| 29 |
from qvm_formatter_support import formatter_env
|
| 30 |
from qvm_byte_memory_support import write_bytes
|
| 31 |
from qvm_exit_rules_support import CPOOL
|
| 32 |
-
m,b=formatter_env(raw,h);m.update({23708:0,23712:0,34992496:CPOOL})
|
| 33 |
write_bytes(m,b,{a:raw[h['data_offset']+a] for lo,hi in [(83632,83824),(55500,55564)] for a in range(lo,hi)})
|
| 34 |
return m,b
|
| 35 |
|
|
@@ -41,7 +41,7 @@ def save_position(ins,m,b,pointer,userinfo,mapname,handle,open_return=0):
|
|
| 41 |
def supplied(data,dest,capacity):return {dest+j:v for j,v in enumerate((data.split(b'\0')[0][:capacity-1]+b'\0').ljust(capacity,b'\0'))}
|
| 42 |
def info(i,m,a,bs):events.append(dict(op='userinfo',slot=a[8]));return m,0,{'engine_userinfo_supplied':True,'child_memory_bytes':supplied(userinfo,a[12],a[16])}
|
| 43 |
def lookup(i,m,a,bs):
|
| 44 |
-
m,v,p,b=info_lookup(i,m,dict(bs),a);children.append([70503,p['execution']['trace_sha256']]);return m,v,{'actual_source_child':70503}
|
| 45 |
def current(i,m,a,bs):events.append(dict(op='map'));return m,0,{'engine_map_supplied':True,'child_memory_bytes':supplied(mapname,a[12],a[16])}
|
| 46 |
def fmt(i,m,a,bs):return final_format(i,m,a,dict(bs),formatter)
|
| 47 |
def open_file(i,m,a,bs):events.append(dict(op='open',path=cstring(m,bs,a[8]).hex(),mode=a[16]));return m,open_return,{'file_open_supplied':True,'child_memory_bytes':{a[12]+j:(handle>>(8*j))&255 for j in range(4)}}
|
|
@@ -50,3 +50,21 @@ def save_position(ins,m,b,pointer,userinfo,mapname,handle,open_return=0):
|
|
| 50 |
def write(i,m,a,bs):events.append(dict(op='write',handle=a[16],length=a[12],data=read_bytes(m,bs,a[8],a[12]).hex()));return m,0,{'native_file_write_captured':True}
|
| 51 |
def close(i,m,a,bs):events.append(dict(op='close',handle=a[8]));return m,0,{'native_file_close_captured':True}
|
| 52 |
m,v,p,b=run(ins,m,246746,246936,1176,{8:pointer},b,{-21:info,70503:lookup,-8:current,70458:fmt,-11:open_file,70386:row,-13:write,-14:close},base=B+0x35000);p.update(events=events,children=children,warnings=warnings);return m,p,b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
from qvm_formatter_support import formatter_env
|
| 30 |
from qvm_byte_memory_support import write_bytes
|
| 31 |
from qvm_exit_rules_support import CPOOL
|
| 32 |
+
m,b=formatter_env(raw,h);m.update({23708:0,23712:0,34992496:CPOOL});m.update({35096232+4*j:0 for j in range(4096)})
|
| 33 |
write_bytes(m,b,{a:raw[h['data_offset']+a] for lo,hi in [(83632,83824),(55500,55564)] for a in range(lo,hi)})
|
| 34 |
return m,b
|
| 35 |
|
|
|
|
| 41 |
def supplied(data,dest,capacity):return {dest+j:v for j,v in enumerate((data.split(b'\0')[0][:capacity-1]+b'\0').ljust(capacity,b'\0'))}
|
| 42 |
def info(i,m,a,bs):events.append(dict(op='userinfo',slot=a[8]));return m,0,{'engine_userinfo_supplied':True,'child_memory_bytes':supplied(userinfo,a[12],a[16])}
|
| 43 |
def lookup(i,m,a,bs):
|
| 44 |
+
m,v,p,b=info_lookup(i,m,dict(bs),a);children.append([70503,p['execution']['trace_sha256']]);return m,v,{'actual_source_child':70503,'child_memory_bytes':{v+j:x for j,x in enumerate(cstring(m,b,v)+b'\0')}}
|
| 45 |
def current(i,m,a,bs):events.append(dict(op='map'));return m,0,{'engine_map_supplied':True,'child_memory_bytes':supplied(mapname,a[12],a[16])}
|
| 46 |
def fmt(i,m,a,bs):return final_format(i,m,a,dict(bs),formatter)
|
| 47 |
def open_file(i,m,a,bs):events.append(dict(op='open',path=cstring(m,bs,a[8]).hex(),mode=a[16]));return m,open_return,{'file_open_supplied':True,'child_memory_bytes':{a[12]+j:(handle>>(8*j))&255 for j in range(4)}}
|
|
|
|
| 50 |
def write(i,m,a,bs):events.append(dict(op='write',handle=a[16],length=a[12],data=read_bytes(m,bs,a[8],a[12]).hex()));return m,0,{'native_file_write_captured':True}
|
| 51 |
def close(i,m,a,bs):events.append(dict(op='close',handle=a[8]));return m,0,{'native_file_close_captured':True}
|
| 52 |
m,v,p,b=run(ins,m,246746,246936,1176,{8:pointer},b,{-21:info,70503:lookup,-8:current,70458:fmt,-11:open_file,70386:row,-13:write,-14:close},base=B+0x35000);p.update(events=events,children=children,warnings=warnings);return m,p,b
|
| 53 |
+
|
| 54 |
+
def load_position(ins,m,b,pointer,userinfo,mapname,handle,length,data):
|
| 55 |
+
from qvm_scoreboard_wire_support import final_format
|
| 56 |
+
from qvm_formatter_support import formatter
|
| 57 |
+
events=[];scan_result=None;children=[]
|
| 58 |
+
def supplied(data,dest,capacity):return {dest+j:v for j,v in enumerate((data.split(b'\0')[0][:capacity-1]+b'\0').ljust(capacity,b'\0'))}
|
| 59 |
+
def info(i,m,a,bs):events.append(dict(op='userinfo',slot=a[8]));return m,0,{'engine_userinfo_supplied':True,'child_memory_bytes':supplied(userinfo,a[12],a[16])}
|
| 60 |
+
def lookup(i,m,a,bs):
|
| 61 |
+
m,v,p,b=info_lookup(i,m,dict(bs),a);children.append([70503,p['execution']['trace_sha256']]);return m,v,{'actual_source_child':70503,'child_memory_bytes':{v+j:x for j,x in enumerate(cstring(m,b,v)+b'\0')}}
|
| 62 |
+
def current(i,m,a,bs):events.append(dict(op='map'));return m,0,{'engine_map_supplied':True,'child_memory_bytes':supplied(mapname,a[12],a[16])}
|
| 63 |
+
def fmt(i,m,a,bs):return final_format(i,m,a,dict(bs),formatter)
|
| 64 |
+
def open_file(i,m,a,bs):events.append(dict(op='open',path=cstring(m,bs,a[8]).hex(),mode=a[16]));return m,length,{'file_open_supplied':True,'child_memory_bytes':{a[12]+j:(handle>>(8*j))&255 for j in range(4)}}
|
| 65 |
+
def read(i,m,a,bs):events.append(dict(op='read',handle=a[16],length=a[12]));return m,0,{'file_read_supplied':True,'child_memory_bytes':{a[8]+j:v for j,v in enumerate(data[:a[12]].ljust(a[12],b'\0'))}}
|
| 66 |
+
def parse(i,m,a,bs):
|
| 67 |
+
nonlocal scan_result
|
| 68 |
+
m,v,p,b=scanner(i,m,dict(bs),a);scan_result=v;children.append([38326,p['execution']['trace_sha256']]);return m,v,{'actual_source_child':38326}
|
| 69 |
+
def close(i,m,a,bs):events.append(dict(op='close',handle=a[8]));return m,0,{'native_file_close_captured':True}
|
| 70 |
+
m,v,p,b=run(ins,m,246554,246744,1192,{8:pointer},b,{-21:info,70503:lookup,-8:current,70458:fmt,-11:open_file,-12:read,38326:parse,-14:close},base=B+0x37000);p.update(events=events,scan_result=scan_result,children=children);return m,p,b
|
scripts/test_qvm_position_load.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
class OriginalTests(unittest.TestCase):
|
| 4 |
+
def test_instruction_results(self):
|
| 5 |
+
rows=json.loads(Path('docs/research/qvm-position-load.json').read_text())['probes']
|
| 6 |
+
self.assertEqual(len(rows),96)
|
| 7 |
+
from qvm_scan_oracle import scan
|
| 8 |
+
for p in rows:
|
| 9 |
+
a=p['input'];events=[];result=None;values=a['values'];ring=ir=0
|
| 10 |
+
if a['mode']==9:
|
| 11 |
+
events.append(dict(op='userinfo',slot=3));ir=1
|
| 12 |
+
if a['enabled']>=1:
|
| 13 |
+
events.extend([dict(op='map'),dict(op='open',path=b'positions/ut4_test/ID.pos'.hex(),mode=0)]);ring=1
|
| 14 |
+
if a['handle'] and 0<a['length']<1023:
|
| 15 |
+
events.extend([dict(op='read',handle=a['handle'],length=a['length']),dict(op='close',handle=a['handle'])]);result,words=scan(bytes.fromhex(a['data'])[:a['length']].ljust(a['length'],b'\0'),'f',6)
|
| 16 |
+
if result==6:values=words
|
| 17 |
+
self.assertEqual(p['events'],events);self.assertEqual(p['scan_result'],result);self.assertEqual(p['values'],values);self.assertEqual(p['ring'],ring);self.assertEqual(p['info_ring'],ir)
|
| 18 |
+
|
| 19 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -2762,3 +2762,9 @@ report scripts/analyze_rust_position_save.py docs/research/rust-position-save.js
|
|
| 2762 |
edge docs/research/rust-position-save.json scripts/test_rust_position_save.py
|
| 2763 |
group rust-position-save scripts/analyze_rust_position_save.py
|
| 2764 |
edge scripts/analyze_rust_position_save.py scripts/analyze_qvm_resumer_audit.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2762 |
edge docs/research/rust-position-save.json scripts/test_rust_position_save.py
|
| 2763 |
group rust-position-save scripts/analyze_rust_position_save.py
|
| 2764 |
edge scripts/analyze_rust_position_save.py scripts/analyze_qvm_resumer_audit.py
|
| 2765 |
+
edge scripts/qvm_scan_oracle.py scripts/test_qvm_position_load.py
|
| 2766 |
+
report scripts/analyze_qvm_position_load.py docs/research/qvm-position-load.json
|
| 2767 |
+
edge docs/research/qvm-position-load.json scripts/test_qvm_position_load.py
|
| 2768 |
+
group qvm-position-load scripts/analyze_qvm_position_load.py
|
| 2769 |
+
edge scripts/analyze_qvm_position_load.py scripts/analyze_qvm_resumer_audit.py
|
| 2770 |
+
group qvm-position-load scripts/analyze_qvm_position_save.py
|