AVA2 client Windows parity passes (gr2 BitKnit2/64-bit, GamePhase handlers, python modules)

- gr2: BitKnit2 decompression, 64-bit LE files, compressed curves
- net: remaining GamePhase handlers, generated GC packet table
- python: event/chat/chr/minimap/guild/quest/messenger/shop-search and
  other native modules ported against the AVA2 Windows client
- render: D3D8 fixed-function lighting in Gr2ModelRenderer, terrain
  without baked shade; cape/NPC equipment attachment
- tests + audits updated; docs/PORT-PLAN.md and WINDOWS-PARITY.md

Batch 4 (render pipeline: background.*, app.RenderGame/UpdateGame,
camera bindings, main.cpp fake-content removal) is still in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-08 10:43:01 +09:00
co-authored by Claude Opus 5.5
parent 9f748eb05a
commit 9077aa389a
145 changed files with 22692 additions and 6584 deletions
+17 -4
View File
@@ -19,16 +19,29 @@ def modules(paths,preprocess=False):
for call in re.finditer(r'Py_InitModule\s*\(\s*"([^"\n]+)"\s*,\s*(\w+)',source):
candidates=[t for t in tables if t[1]==call[2] and t.start()<call.start()]
if not candidates: continue
methods={name:handler for name,handler in re.findall(r'\{\s*"([^"\n]+)"\s*,\s*(\w+)\s*,',candidates[-1][2])}
result[call[1]]={'path':str(path.relative_to(root)),'methods':methods}
methods={name:handler for name,handler in re.findall(r'\{\s*"([^"\n]+)"\s*,\s*(\w+(?:<[^>{}]*>)?)\s*,',candidates[-1][2])}
if call[1] in result:
result[call[1]]['methods'].update(methods)
else:
result[call[1]]={'path':str(path.relative_to(root)),'methods':methods}
return result
windows=modules(sorted((root/'upstream/ava2-client').rglob('*Module.cpp')),True)
# Only translation units listed in AVA2's Windows build are reference modules.
# Orphan .cpp files (e.g. guild_ranking) do not define the shipped client API.
import xml.etree.ElementTree as ET
compiled=set()
for project in (root/'upstream/ava2-client').rglob('*.vcxproj'):
for node in ET.parse(project).getroot().iter():
if node.tag.rsplit('}',1)[-1]=='ClCompile' and 'Include' in node.attrib:
compiled.add((project.parent/node.attrib['Include'].replace('\\','/')).resolve())
reference_paths=[p for p in sorted(compiled) if p.is_file() and
re.search(r'\bPy_InitModule\s*\(',p.read_text(errors='replace'))]
windows=modules(reference_paths,True)
port=modules(sorted((root/'src').glob('python_*.cpp')))
rows=[]
for name,reference in sorted(windows.items()):
target=port.get(name,{'methods':{}});original=set(reference['methods']);current=set(target['methods'])
rows.append({'module':name,'windows_file':reference['path'],'port_file':target.get('path'),'windows_methods':len(original),'missing':sorted(original-current),'extra':sorted(current-original),'placeholder':sorted(method for method in original&current if 'dummy' in target['methods'][method])})
report={'basis':'AVA2 Windows active method tables; module constants/signatures/behavior require further audit','modules':rows,'missing_method_count':sum(len(r['missing']) for r in rows),'placeholder_method_count':sum(len(r['placeholder']) for r in rows)}
report={'basis':'AVA2 Windows project-compiled active method tables; module constants/signatures/behavior require further audit','modules':rows,'missing_method_count':sum(len(r['missing']) for r in rows),'placeholder_method_count':sum(len(r['placeholder']) for r in rows)}
(root/'docs/AVA2-PYTHON-INTERFACES.json').write_text(json.dumps(report,indent=2)+'\n')
print(f"{len(rows)} Windows modules compared; {report['missing_method_count']} missing methods; {report['placeholder_method_count']} overlapping placeholder methods")
for row in rows: