urt-rs / docs /research /QVM_FIRE_RESOURCE.md
nmarshall's picture
qvm: firing resource accounting
4c9911c
|
Raw History Blame Contribute Delete
1.5 kB

Firing resource snapshot capacity arithmetic and reset

RE-588. Reproduce with python3 scripts/analyze_qvm_fire_resource.py; check with python3 scripts/test_qvm_fire_resource.py. The machine report retains source identity and bounded fixtures.

Without preserved local-mode flag16, PS216 receives prior PS188. The source computes signed integer30000/capacity, converts it through float and back to integer, adds with32-bit semantics, upper-clamps values above30000, then loads mode+24 into PS196. For the finite quotients tested the float conversions retain the integer result. No lower clamp occurs here.

Flag16 zeros PS216/196/188 and bypasses division, including a supplied capacity0 fixture. Capacity0 without that flag is outside the bounded evaluator domain and is reported as a rejection rather than fabricated behavior.101 fixtures include synthetic negative/overflow cases to isolate literal arithmetic; these do not establish legal configuration.

Resource semantics, writers and downstream effects still require native/reference evidence. This completes local accounting only, with no native firing operation or ammo/counter/request mutation in this slice. The next task follows when the selected firing delay is actually added.

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.