re: the chatter phase merge is not additive; 224 authored variants never play

sub_82215A58 reads CrewCount + PresetMessage_Phase1/2/3 and reaches the loader
from ONE call site, so the three phase tables fold into one map keyed by the
event record name.  Every merge collides; sub_82213840 reconciles on the
message list plus +16/+17/+18/+20/+24/+28 (NOT the +32 Yes mask), and the
incumbent always wins.  Measured: 26432 collisions, 26208 identical, 224
different (189 differ only in the message list), 0 mask-only differences.

Refuted handle: intersecting functions by the object's offsets finds dozens of
unrelated layouts -- offset shape is not an identifier.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PMRJjbxLqZtsb5Vb7KunPE
This commit is contained in:
Claude (auto)
2026-08-27 16:50:42 +00:00
parent 0f7ce6d6cb
commit 1d372d8083
5 changed files with 179 additions and 5 deletions

View File

@@ -190,6 +190,63 @@ def main():
for m in miss:
print(' %s' % m)
# phase-merge reconciliation: sub_82215A58 loads a unit's Phase1/2/3 tables
# into ONE map keyed by the event record name, and sub_82213840 compares a
# duplicate against the incumbent on (message list, +16, +17, +18, +20, +24,
# +28) -- not on the Yes mask at +32.
CMP = ('Probability', 'Priority', 'Pattern', 'Interval',
'IntervalFluctuation', 'EffectiveTime')
def _core(rec):
d = U.named(rec)
pos = [v for _, nm, v in rec['fields'] if nm is None]
return ((tuple(d.get(f) for f in CMP), tuple(pos[0::2])), tuple(pos[1::2]))
sets = dup = same = diff = mask_only = 0
why = collections.Counter()
for st in STAGES:
h = U.name_hash('message\\UnitMessageSet_%s.tbl' % st)
if h not in entries:
continue
for r in U.parse(entries[h]):
d = U.named(r)
phases = [d.get('PresetMessage_Phase%d' % i) for i in (1, 2, 3)]
phases = [n for n in phases if n]
if len(phases) < 2:
continue
sets += 1
seen = {}
for n in phases:
hh = U.name_hash('message\\' + n)
if hh not in entries:
continue
for rec in U.parse(entries[hh]):
if rec['squadron'] == 'Sperkers':
continue
core, mask = _core(rec)
k = rec['squadron']
if k not in seen:
seen[k] = (core, mask)
continue
dup += 1
if seen[k][0] == core:
same += 1
if seen[k][1] != mask:
mask_only += 1
else:
diff += 1
w = [f for f, a, b in zip(CMP, seen[k][0][0], core[0]) if a != b]
if seen[k][0][1] != core[1]:
w.append('MESSAGE_LIST')
why[tuple(w)] += 1
print()
print('phase merge (the loader folds Phase1/2/3 into one map):')
print(' UnitMessageSet records naming >= 2 phase tables : %d' % sets)
print(' duplicate-key insertions to reconcile : %d' % dup)
print(' identical on the compared fields : %d' % same)
print(' DIFFERENT -> loader clears its ok flag : %d' % diff)
print(' compared fields equal but Yes mask differs : %d' % mask_only)
for w, c in why.most_common():
print(' x%-5d %s' % (c, ', '.join(w)))
# naming, two independent routes
harvest = set()
for p in sorted(glob.glob(os.path.join(DAT, '**', '*.pak'), recursive=True)):