Files
BT411/scratchpad/night10/digest_walk.py
T
Joe DiPrimaandClaude Fable 5 fe48accb6b #87 root cause: the level-crossing zone-record send was missing -- observers never saw damage
The binary's effect watcher (FUN_0042aa2c) raises
ForceUpdate(DamageZoneUpdateModelFlag) when a zone's damageLevel CROSSES a
band-descriptor threshold (FUN_0042a5f4, master-gated on entity+0x28 & 0xc)
-- that send is how every other pod's replicant learns zone levels
mid-fight. The port's band hub kept only the graphic-state branch, so an
observer's copy sat at 0.0 until destruction: no enemy hull darkening, no
doll movement, ever (the night-10 "no armour discoloration" report).

Restored the level branch with the already-reconstructed DescriptorCrossed
(@0042a5f4) + the master gate on both branches (mesh swap still runs on
every instance). 2-node verified: A-side armour watcher pushed 114 level
changes; every replicant peak matched the master's finals to 4 decimals
(dtorso 0.9321 == 0.9321).

Render path cleared separately (gotcha #23 discharged): BT_ARMOR_FORCE 0/1
A/B captures prove the tint renders (hull -> charcoal at 1.0). Solo
perception is the authentic economy: 2-25 pt lasers vs 68-185 pt pools.

Bench: zonewalk.sh node A now carries BT_ARMOR_LOG + BT_SHOT_EVERY (the
standing zone-replication receipt) + digest_walk.py; armorpx.sh is the
force-pair pixel rig.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 12:24:36 -05:00

57 lines
2.4 KiB
Python

#!/usr/bin/env python3
# Digest the instrumented zone-walk: per-zone level progressions on B (master),
# replicant levels seen by A's armor watcher, and the per-hit damage economy.
import re, sys, collections
def rd(p):
with open(p, 'rb') as f:
return f.read().decode('utf-8', 'replace')
a = rd(r'C:\git\bt411\content\zw_a.log')
b = rd(r'C:\git\bt411\content\zw_b.log')
# idx -> name from A's walk lines: zone N 'name'
names = {}
for m in re.finditer(r"zone (\d+) '([^']+)'", a):
names[int(m.group(1))] = m.group(2)
# B-side consumption: [dmghit] mech=E zone=N ... amt=X ... lvl P->Q
zones = collections.defaultdict(lambda: {'hits': 0, 'amt': 0.0, 'first': None, 'last': 0.0})
hitlines = re.findall(r"\[dmghit\] mech=(\S+) zone=(\d+) vital=(\d+) type=(\d+) amt=([\d.eE+-]+) burst=(\d+) lvl ([\d.eE+-]+)->([\d.eE+-]+)", b)
mechs = collections.Counter(m[0] for m in hitlines)
victim = mechs.most_common(1)[0][0] if mechs else None
for mech, zi, vital, typ, amt, burst, p, q in hitlines:
if mech != victim:
continue
z = zones[int(zi)]
z['hits'] += 1
z['amt'] += float(amt)
if z['first'] is None:
z['first'] = float(p)
z['last'] = float(q)
print(f"victim {victim}: {sum(z['hits'] for z in zones.values())} hits into {len(zones)} zones")
print(f"{'zone':>4} {'name':<12} {'hits':>4} {'amt/hit':>8} {'lvl first->last':>18}")
for zi in sorted(zones, key=lambda k: -zones[k]['last']):
z = zones[zi]
per = z['amt'] / z['hits'] if z['hits'] else 0
print(f"{zi:>4} {names.get(zi, '?'):<12} {z['hits']:>4} {per:>8.3f} {z['first']:>8.4f} -> {z['last']:<8.4f}")
# A-side replicant levels: [armor] '<mat>' zone N level P -> Q
arm = re.findall(r"\[armor\] '[^']*' zone (\d+) level ([\d.eE+-]+) -> ([\d.eE+-]+)", a)
if arm:
peak = collections.defaultdict(float)
for zi, p, q in arm:
peak[int(zi)] = max(peak[int(zi)], float(q))
print(f"\nA-side watcher: {len(arm)} level-change pushes; replicant peaks:")
for zi in sorted(peak, key=lambda k: -peak[k])[:12]:
print(f" zone {zi:>3} {names.get(zi, '?'):<12} peak {peak[zi]:.4f}")
else:
print("\nA-side watcher: NO level-change pushes (replicant levels never moved)")
# zone-repl confirmations on A
zr = re.findall(r"\[zone-repl\] zone (\d+) '([^']+)' lvl ([\d.eE+-]+)->([\d.eE+-]+)", a)
print(f"\n[zone-repl] on A: {len(zr)} lines")
for zi, nm, p, q in zr[:8]:
print(f" zone {zi} {nm} {p}->{q}")