nmarshall commited on
Commit
d146bf5
·
1 Parent(s): 95639cd

qvm: health credit and damage records

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -841,3 +841,6 @@ RE-714–723 batch complete: [complete contact and health prefixes](research/QVM
841
 
842
 
843
  Research progress: RE-725 [report](research/QVM_HEALTH_ROUTING.md); original assets unchanged.
 
 
 
 
841
 
842
 
843
  Research progress: RE-725 [report](research/QVM_HEALTH_ROUTING.md); original assets unchanged.
844
+
845
+
846
+ Research progress: RE-726 [report](research/QVM_HEALTH_CREDIT.md); original assets unchanged.
docs/FINDINGS.md CHANGED
@@ -1187,3 +1187,6 @@ RE-714–723 batch complete: [complete contact and health prefixes](research/QVM
1187
 
1188
 
1189
  **RE-725 — Health pointer fallback and target routing:** Null inflictor/attacker become world34990728; target kind4 with a nonmagic checksum diverts to a guarded callback and exits before normal health logic. [Evidence](research/QVM_HEALTH_ROUTING.md).
 
 
 
 
1187
 
1188
 
1189
  **RE-725 — Health pointer fallback and target routing:** Null inflictor/attacker become world34990728; target kind4 with a nonmagic checksum diverts to a guarded callback and exits before normal health logic. [Evidence](research/QVM_HEALTH_ROUTING.md).
1190
+
1191
+
1192
+ **RE-726 — Health attacker credit and client damage records:** Health bookkeeping adjusts attacker client252, clamps incoming integer damage to at least1 and publishes per-client damage, direction/origin, attacker and method fields before health subtraction. [Evidence](research/QVM_HEALTH_CREDIT.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1176,3 +1176,6 @@ RE-714–723 batch complete: [complete contact and health prefixes](research/QVM
1176
 
1177
 
1178
  Research progress: RE-725 [report](research/QVM_HEALTH_ROUTING.md); full native/platform/game scope remains open.
 
 
 
 
1176
 
1177
 
1178
  Research progress: RE-725 [report](research/QVM_HEALTH_ROUTING.md); full native/platform/game scope remains open.
1179
+
1180
+
1181
+ Research progress: RE-726 [report](research/QVM_HEALTH_CREDIT.md); full native/platform/game scope remains open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -1268,3 +1268,8 @@ Added cargo xtask orchestration for Git changes, transitive Python import/report
1268
  ## 2026-10-21 — RE-725 Health pointer fallback and target routing
1269
 
1270
  Null inflictor/attacker become world34990728; target kind4 with a nonmagic checksum diverts to a guarded callback and exits before normal health logic. Focused `cargo xtask test-group health` passes (12 Python tests); selected reports regenerate twice byte-identically, with storage, links and whitespace guards. New report: 228345 bytes. Full-suite validation is deferred to the tenth batch commit. No original assets, Rust runtime or shared VM evaluator changed.
 
 
 
 
 
 
1268
  ## 2026-10-21 — RE-725 Health pointer fallback and target routing
1269
 
1270
  Null inflictor/attacker become world34990728; target kind4 with a nonmagic checksum diverts to a guarded callback and exits before normal health logic. Focused `cargo xtask test-group health` passes (12 Python tests); selected reports regenerate twice byte-identically, with storage, links and whitespace guards. New report: 228345 bytes. Full-suite validation is deferred to the tenth batch commit. No original assets, Rust runtime or shared VM evaluator changed.
1271
+
1272
+
1273
+ ## 2026-10-21 — RE-726 Health attacker credit and client damage records
1274
+
1275
+ Health bookkeeping adjusts attacker client252, clamps incoming integer damage to at least1 and publishes per-client damage, direction/origin, attacker and method fields before health subtraction. Focused `cargo xtask test-group health` passes (16 Python tests); selected reports regenerate twice byte-identically, with storage, links and whitespace guards. New report: 735718 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
@@ -1219,3 +1219,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1219
 
1220
 
1221
  - [x] RE-725 Health pointer fallback and target routing ([report](research/QVM_HEALTH_ROUTING.md)).
 
 
 
 
1219
 
1220
 
1221
  - [x] RE-725 Health pointer fallback and target routing ([report](research/QVM_HEALTH_ROUTING.md)).
1222
+
1223
+
1224
+ - [x] RE-726 Health attacker credit and client damage records ([report](research/QVM_HEALTH_CREDIT.md)).
docs/research/QVM_HEALTH_CREDIT.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Health attacker credit and client damage records
2
+
3
+ RE-726. Reproduce with `python3 scripts/analyze_qvm_health_credit.py`; validate with `cargo xtask test-group health`. See the [machine report](qvm-health-credit.json).
4
+
5
+ Actual211850–212157 updates attacker client252 only for a distinct client attacker against a live target whose kind is not0/3/4. Enabled-mode same-team client targets decrement credit; other eligible targets increment. Incoming damage below1 becomes1. Method23 accumulates client4084 and publishes target world origin; other methods accumulate4088 and publish supplied direction or world origin for null direction, with4108 selecting the source. Client272/4128 receive attacker ID,4132 receives method, and method6 damage≥30 ORs128 into client12. Fixtures supply post-routing pointers and selected client local36. No health subtraction or callback execution occurs.
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
@@ -777,3 +777,6 @@ The extension collector adds five focused tests for native tail calls, command-r
777
 
778
 
779
  [RE-725: Health pointer fallback and target routing](QVM_HEALTH_ROUTING.md).
 
 
 
 
777
 
778
 
779
  [RE-725: Health pointer fallback and target routing](QVM_HEALTH_ROUTING.md).
780
+
781
+
782
+ [RE-726: Health attacker credit and client damage records](QVM_HEALTH_CREDIT.md).
docs/research/qvm-health-credit.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_health_credit.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """211239 attacker credit, minimum damage and client damage feedback state."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source
6
+ from qvm_health_effects_support import seed,run
7
+ from analyze_qvm import write_json
8
+
9
+ def main():
10
+ q,raw,h,ins=source();rows=[]
11
+ cases=[dict(method=method,damage=damage,self=self_hit,same_team=same,mode=mode) for method,damage,self_hit,same,mode in itertools.product([6,12,23],[-2,0,29,30,100],[False,True],[False,True],[2,3,9])]
12
+ cases += [dict(method=method,client=False,damage=damage) for method,damage in itertools.product([12,23],[0,100])]
13
+ cases += [dict(target_kind=kind,health=health) for kind,health in itertools.product([0,3,4],[0,100])]
14
+ cases += [dict(method=method,direction=None,attacker_client=client) for method,client in itertools.product([12,23],[False,True])]
15
+ for a in cases:
16
+ _,p=run(ins,seed(raw,h,**a),211850,212158);p['input']=a;rows.append(p)
17
+ write_json(Path('docs/research/qvm-health-credit.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual211850..212157 with pointers supplied after routing and local36 preselected client. No health subtraction/callback/native effects. Damage accumulator naming is structural; live input legality remains open.'})
18
+ if __name__=='__main__':main()
scripts/test_qvm_health_credit.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+ from test_qvm_ground import word
4
+ class HealthCreditTests(unittest.TestCase):
5
+ @classmethod
6
+ def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-health-credit.json').read_text())['probes']
7
+ def test_independent_attacker_credit_rules(self):
8
+ for p in self.ps:
9
+ a=p['input'];active=a.get('attacker_client',True) and not a.get('self',False) and a.get('health',100)>0 and a.get('target_kind',1) not in (0,3,4);enabled=a.get('mode',3)>=3 and a.get('mode',3) not in (9,11);value=(-1 if a.get('client',True) and enabled and a.get('same_team',False) else 1) if active else 0
10
+ self.assertEqual(p['final']['attacker_credits'],value&0xffffffff)
11
+ def test_minimum_damage_is_one(self):
12
+ for p in self.ps:
13
+ take=max(1,p['input'].get('damage',100));self.assertEqual(p['final']['selected_damage'],take);self.assertEqual(p['final']['args']['136'],take)
14
+ def test_client_accumulators_and_publication(self):
15
+ for p in self.ps:
16
+ a=p['input'];cl=p['final']['client']
17
+ if cl is None:continue
18
+ take=max(1,a.get('damage',100));method=a.get('method',12);world=method==23 or a.get('direction',[3,4,0]) is None;values=[10,20,30] if world else a.get('direction',[3,4,0]);self.assertEqual(cl['4084'],take if method==23 else 0);self.assertEqual(cl['4088'],0 if method==23 else take);self.assertEqual([cl[str(o)] for o in [4096,4100,4104]],list(map(word,values)));self.assertEqual(cl['4108'],int(world));self.assertEqual(cl['272'],65 if a.get('self',False) else 7);self.assertEqual(cl['4128'],65 if a.get('self',False) else 7);self.assertEqual(cl['4132'],method);self.assertEqual(cl['12'],8|(128 if method==6 and take>=30 else 0))
19
+ def test_no_health_effects_and_source_child_scope(self):
20
+ self.assertEqual(len(self.ps),194)
21
+ for p in self.ps:self.assertEqual(p['initial']['entity'],p['final']['entity']);self.assertTrue(all(not v for v in p['effects'].values()));self.assertTrue(all(c['target']==33715 for c in p['execution']['calls']))
22
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -1145,3 +1145,5 @@ report scripts/analyze_world_links.py docs/research/world-links.json
1145
  version 1
1146
  report scripts/analyze_qvm_health_routing.py docs/research/qvm-health-routing.json
1147
  edge docs/research/qvm-health-routing.json scripts/test_qvm_health_routing.py
 
 
 
1145
  version 1
1146
  report scripts/analyze_qvm_health_routing.py docs/research/qvm-health-routing.json
1147
  edge docs/research/qvm-health-routing.json scripts/test_qvm_health_routing.py
1148
+ report scripts/analyze_qvm_health_credit.py docs/research/qvm-health-credit.json
1149
+ edge docs/research/qvm-health-credit.json scripts/test_qvm_health_credit.py