Agent workflow: follow the highest-priority requirements in AGENTS.md. Use affected exact checks and searchable Markdown knowledge; ordinary notes do not require full CI or replay.
Source reconstruction of the original Japanese TH20 v1.00a Steamless executable. Function-level exactness requires reproducible comparison against one hash-attested target. The workflow follows TH095, with Ghidra and a separate modern MSVC environment for TH20.
Important
Reconstruction is in progress. Verified source components and exact function comparisons are available; the repository does not yet build a playable game. Origin review, source presence, exactness, linkage and runtime behavior are separate statuses.
Supply your own executable as resources/th20.exe:
| Property | Required value |
|---|---|
| Version | Japanese 1.00a, user-selected Steamless variant |
| Embedded title/replay label | 1.00c; recorded separately from registry/package identification |
| Size | 1,858,560 bytes |
| SHA-256 | a274b45fe6ec53511718bb328c2ff169a74e67f95d1b0c74d97d348b955a0897 |
| MD5 | e7ccdbd2f319ba868ce386e484fff1d3 |
| Image base | 0x00400000 |
| Entry point | 0x005435E0 |
scripts/import-target.sh /path/to/th20.exe
scripts/repo-python scripts/verify-target.pyThe Steam-original backup is retained locally as provenance evidence. Its code differs from the comparison target. See target provenance for official Japanese release and independent executable identification. Game executables, assets, private databases, toolchains and reference checkouts are excluded from Git.
At the November 11, 2026 checkpoint, the tracked source inventory covers
1,586 functions, with 1,584 strict native units built from 438
canonical MSVC object/receipt providers. Independently validated
game-authored whole-function exactness is 775 functions /265,737
original .text bytes. This is a dated snapshot, not a playable-game
or whole-project-build claim. Run
scripts/repo-python scripts/report-reconstruction-status.py --summary
for live counts and read the
current agent handoff and
remaining Boss backlog before continuing.
| Area | Verified live state and detailed evidence |
|---|---|
| Large exact game functions | Original 11,110B ECL runtime tick, 3,735B Bullet emitter, 3,490B InputDevice polling, and other accepted whole bodies; the complete physical credit is in config/matches.csv. |
| Recently completed Renderer/game IO | Whole strict exact 508B +511B Renderer list-update Bosses (independently preserving 82/82 prior exact consumers), 417B Unicode formatted-text caller, and 157B game filesystem-exists wrapper with actual narrow const char* source. Renderer pair, text, file exists. The separate 40B list ctor/42B reset and 586B centered text remain NONEXACT. |
| Animation quad-submit Boss | Original 3,159B body /3,180B complete relocated contribution strict exact. Its separate 20B standard round(float) header wrapper is strict exact but library, not authored game code. |
| Animation rendering backends | Original 4,347B Mode8, 2,769B Mode6, 1,378B Mode6 setup, 1,996B Mode7 setup, 753B Mode7, and 2,136B mesh24/25 each independently whole strict exact. Mode8, Mode6, Mode6 setup, Mode7 setup, mesh. Their enclosing 5,993B Draw dispatcher remains NONEXACT. |
| Animation geometry Bosses | Independently exact 2,169B closed line, 1,980B rectangle, 1,601B triangle, 1,468B ring, and many 375B–1,174B fan/ellipse/strip renderers. Source-native proof index supplies the individual original heads and relocation roles; exact children do not complete the 5,993B Draw dispatcher. |
| Separate ribbon Motion-group pipeline | Separate native 538B segment dynamics Boss, 140B group update, 156B draw, 76B LINESTRIP wrapper, 89B polymorphic ctor, 60B segment ctor and 47B allocation/config wrapper are independently whole strict exact game-authored functions. Their 78B triple-array ctor, 156B diagnostic allocation factory, 20B/49B destructor pair, two 19B radius/point ends and 19B group array-end are whole native exact with unresolved compiler/template or source ownership, hence not duplicate authored credit. Three 0x3C0-byte segments and the pointer-bearing +0xB5C member preserve real native vtable/auto-zero ABI. The separate 252B ribbon configuration Boss, its 23B segment-array index, and the 88B palette with two 31B forwarding helpers, plus the 75B ribbon 60-color array constructor, are independently whole strict exact; the whole game does not link or play. 538B dynamics, 89B/20B/49B ctor and deletion, 78B array, 156B factory, 47B wrapper, 252B configuration, 88B palette and 31B forwarding, 75B color array, 23B index, 140B update, 156B draw, 76B renderer. |
| 64-point ribbon trail object | Original 103B polymorphic ctor and 49B scalar deletion independently whole strict exact under one 0x320-byte native class at original vtable 0x56ED1C. The 520B update Boss is now whole strict exact, and 165B draw Boss is also whole strict exact, and 340B gray configuration now also whole strict exact; 382B magenta alternate configuration is now also whole strict exact. 103B ctor/49B delete, 520B update Boss, 165B draw, 156B factory, 340B gray config, 382B magenta config, 47B/49B entry wrappers, 75B color-array ctor. |
| Separate one-segment ribbon pipeline | Original 140B virtual update, 156B virtual draw and 19B one-past-end pointer all whole strict exact at separate 0x56ECA4 polymorphic vtable; original 697B segment dynamics and 76B renderer are now independently whole exact. Separately, original 123B packed-color and 202B float std::fill_n C++20 bodies are whole strict exact with real unsigned jbe branching, not authored game credit. 140B/19B proof, 89B ctor and 49B delete, 156B solo factory, 47B solo wrapper, 182B solo configuration, 123B solo palette, 156B draw proof, 76B fan, 697B dynamics Boss, 123B/202B library proof. |
| Polygon stroke and group pipeline | Whole strict exact 1,204B polygon outline, 827B dynamics Boss, 60B segment ctor, 296B configuration, 233B group draw, 140B timer tick, 120B palette, 76B fan wrapper, and 47B configuration wrapper. Outline, group, tick/827B frontier, palette. The 827B segment updater is now whole strict exact, including both std::views::drop(1) loops and original 62/61 array sizes. Whole native proof. The original 60B segment ctor and its 75B 4-byte-cell array ctor are now strict exact; construction and genuine padding evidence. The enclosing 113B group constructor and its 78B three-segment array constructor are now whole strict exact. Array native proof. Inheritance/ABI frontier. The generated 49B group scalar-deleting wrapper is also strict exact (compiler code, not authored credit); its ordinary 20B physical destructor was later matched by the genuine ribbon-group folded destructor chain (original polygon-specific source owner still unresolved). Complete 113B/49B proof. The separate 104B outline wrapper remains NONEXACT. The previously missing 156B C++17 group allocation factory is now whole strict exact but counted as an origin-unverified template, not authored game bytes. Factory proof. |
| Compiler/STL-like exact helpers | Seven polygon counted-range leaves, four strict 16B/93B C++20 drop-view helpers, 27 more entire 17B–48B C++20 polygon-range helpers, two 31B palette tag wrappers and two 23B/19B array access helpers are whole native strict exact, but their original authorship is unproven and they are excluded from authored game totals. 27-function range-closure proof. |
| Native 39B/26B/23B generation counter operations | Original true 4B counter postfix increment, &=mask and left-shift generation, three complete strict native 39/39 + 26/26 + 23/23 plus independently exact 187B parent. Compiler/utility provenance still unproven, zero additional game-authored byte credit. Original source/code proof. |
| 187B original RendererPool AnimationHandle registration | Full 187B/56-i386 whole strict exact, native pool +0x07D40E88 generation post-increment/AND0xFFFF/zero guard and Animation+0x4C0/0x4C4 combined 32-bit Handle. Four parent 72/75B registration paths remain strict exact. +187 authored game bytes. PE/COFF proof. |
| RendererPool mode/selection/stride chain | Original 20B mode getter, 38B pool selector and 20B 72-stride slot index all whole strict exact; shared actual +0x6C4/+0x6C8 pool views, parent 922B original still exact, +58 authored game bytes (index20 uncredited as compiler-like source). Complete proof. |
| Four exact Renderer spawn modes | Original complete 72B/72B/75B/75B primary/secondary IntrusiveList<Animation> append/prepend and handle publication, all C++ ABI original; 294 native authored bytes /4 heads and full 922B parent remained 922/922. Original four-mode proof. |
| Particle Update animation timer/color accessors | Full 25B/19B original Timer+0x4D8 and color+0x490 getters with true native PE caller E8 from 2,884B Update; +44 authored-game bytes. Complete native strict evidence. |
| AnimationHandle child lookup path | Entire original 108B/37-i386 child query plus 127B/45-i386 Handle forwarder, original four+five E8 and real security cookies, true hidden AnimationHandle result. +235 game-authored bytes, both 108/108+127/127 strict exact. Complete native evidence. |
| 236B recursive Animation raw-world-position Boss | Genuine original 236B/77-i386 whole strict exact with three Vector3 component operands, native parent Z rotation and original recursive self E8 plus cookie, +236 authored native bytes. Complete original proof. |
| 16B STL file-slot capacity leaf | Native 16B/8-i386 real std::array<AnimationFile*,42>::size(), 0x2A return, original 209B file-slot parent E8. 16/16 strict exact, compiler/STL source excluded from game-authored credit; 2/2 local replay. Proof. |
| 103B original file pointer retirement, no duplicate STL head | Entire 103B/36-i386 strict exact, original lock slot1, existing std::destroy_at<AnimationFile> E8 to already exact original 16B physical address, and actual operator delete; 103B original unknown template origin uncredited. Full 691B/284B/209B/94B lifecycle 5/5 local replay. Original proof. |
| 92B Renderer locked PRNG pulse | Real native 92B/30-i386 whole strict exact, genuine RandomState::next() (library callee uncredited), lock slot10, Game Renderer counter+0x04/output+0x14. Native 5 E8/2 HIGHLOW; +92 authored game bytes under original no-EH /GS MSVC profile. Full PE/COFF proof. |
| 230B Renderer staging draw/owner counter application | Entire native 230B/69-i386 strict exact, true third intrusive list at Renderer+0x30, E8 into original 5,993B draw Boss still NONEXACT, and three original pool+0xD8 HIGHLOW; +230 game-authored bytes. Original 347B/382B/394B chain remains 4/4 exact in 3-object scoped replay. Complete proof. |
| 30B Graphics viewport-mode forwarding | Entire original 30B/14-i386 strict exact, genuine two E8 sites from 806B category Boss, true E8 to the separately exact 280B viewport setter. All 3 matching single-class Graphics symbols, original compiler NOP and ret 8, +30 authored bytes and 3/3 local replay. Native proof. |
| 280B Graphics viewport switch, integrated 806B caller ABI | Whole native 280B/66-i386 strict exact, original ViewportState 0x16C stride, genuine device SetViewport vtable+0xBC, four PE pool HIGHLOW and four native caller E8 from 806B Graphics category Boss. +280 authored bytes, one unified C++ graphics view and affected 6/6 replay. Native proof. |
| 806B Renderer Graphics mode/classification Boss | Full original 806B/211-i386 strict exact, physical 22 E8/28 HIGHLOW to real Graphics global 0x005C4D40 and pool 0x005C0028, genuine state+0x6C0 and six float-zero stores; +806 game-authored bytes and Renderer classification chain 5/5 scoped original replay. Complete native proof. |
| 347B Renderer layer-classification dispatch Boss | Full native 347B/105-i386 strict exact, true 14 E8/3 HIGHLOW and lock9, real original 382B+394B classifications, four 0x48-stride renderer lookups and authentic 806B/230B separate children. +347 authored bytes, 3/3 scoped chain replay. Whole proof. |
| 382B/394B dual Renderer classification Bosses | Both game-owned classification and +0x500 link-staging methods 382/382 +394/394 whole strict exact, true 347B parent E8, 16 native E8/2 HIGHLOW each, first/second 24B lists and third list+0x30. +776 authored game bytes and 2/2 affected unit replay. Complete native proof. |
| 188B Direct3D9 surface clearing | Native 188B/75-i386 whole strict exact, real texture GetSurfaceLevel/Surface GetDesc/LockRect/UnlockRect/Release, original locked pitch×height memset; 2 original E8/one PE HIGHLOW, +188 game-authored bytes. Original proof. |
| 164B Renderer second-list update wrapper | Native complete 164B/46-i386 strict exact, genuine lock9, pool+0xD8 reset and typed 0x48 Renderer first slot, E8 into independently 511B whole-exact secondary update. +164 authored game bytes, 3/3 scoped replay. PE/COFF evidence. |
| 59B GameController-gated Renderer update | Original entire 59B/18-i386 strict exact, genuine current GameController original 3 PE HIGHLOW, two independently exact status checks, E8 to existing exact 150B Renderer gate. +59 authored bytes, 2/2 scoped replay. Full proof. |
| 411B recursive Animation retirement queue | Whole original 411B/116-i386 strict exact: real self recursion, child list traversal and 57B staged append instead of distinct 76B free-list insert_after, all native 18 E8/2 HIGHLOW. +411 game-authored bytes. Complete evidence. |
| 150B Renderer locked list-update wrapper | Whole original 150B/44-i386 strict exact, true slot9 lock and pool+0x6C8 first Renderer, native 6 E8/3 HIGHLOW, directly calls the independently 508B whole-exact update Boss. +150 authored game bytes, 1/1 scoped replay. Original proof. |
| 35B Handle event forwarding and 29B caller ABI correction | Whole distinct 35B/15-i386 strict exact at original 0x0044F0D0 → exact 261B child-event/VM traversal; 29B Dialogue offset+7 originally calls this 35B, not separate older 35B → 246B ordinary interrupt. Shared decorated symbol corrected, 8/8 scoped exact, +35 authored bytes. Original PE evidence. |
| 261B Animation child interrupt/VM visit | Whole original 261B/81-i386 strict exact, true 456B handle resolver, real child-links[1] iteration, native Animation::interrupt(event) followed by real 39,470B VM E8 (VM still NONEXACT), 14 E8/2 HIGHLOW, +261 game-authored bytes. Resolver dependency 5/5 scoped strict. PE native proof. |
| 56B Handle fallback resolver +39B callback forward | Real native 51B Handle resolver followed by genuine resident Animation at pool+0xDC fallback, then original Animation callback write. 56/56 and 39/39 whole strict exact, 3 original E8/one PE HIGHLOW, +95 authored bytes, 10/10 scoped replay; corroborates real 138B pool destructor layout. Complete proof. |
| 138B native AnimationPool owner destructor with genuine 96MiB typed array | Complete original 138B/41-i386 plus physical 5B INT3 (143/143 compared), real Worker+4, Animation+0xDC, Renderer+0x6C8, typed 65,536 × 0x600 PooledAnimation array+0x710 and trailing Animation+0x6000818. True native 6 E8/2 HIGHLOW, +138 authored bytes; Worker/339B/308B scoped 12/12 replay. Full PE and layout proof. |
| 339B Renderer two-list Animation full retirement Boss | Whole original 339B/106-i386 strict exact, native primary/secondary list traversal, all 19 E8/4 HIGHLOW including two genuine 308B pool-retirement calls; +339 game-authored bytes. Strict scoped regression 5/5 across the Renderer and pool chain. Native PE evidence. |
| 308B AnimationPool release Boss and two game-specific helpers | Original whole 308B/80, 82B/22, 90B/27 i386 strict exact, plus uncredited 23B STL 0x600-step index; original 11 E8/2 HIGHLOW in 308B parent. +3 authored game heads/+480 bytes, source-affected 4/4 replay. Native original proof. |
| 691B Renderer file-detachment Boss | 691B/205-i386 whole strict exact, two 24B Animation intrusive lists and genuine 72B renderer slot, native 29 E8 and 2 HIGHLOW including EH/cookie. Real Animation file-ID/byte-flag checks and +0x570 retirement state; +691 authored game bytes with entire 284B/94B/209B file lifecycle replay 4/4. Complete proof. |
| 209B RendererPool AnimationFile slot release | Whole native 209B/61-i386 strict exact, 42-entry AnimationFile* table at original pool+0x06000730, correct original jl/jb/jmp source branch, 8 E8/1 HIGHLOW, actual 284B file clear and object retirement. +209 authored bytes; three-unit local lifecycle replay. Full original proof. |
| 94B texture record COM/allocator retirement | Original 94B/33-i386 whole strict exact, typed Direct3D9 Release(), buffer owner reset and original 284B file-clear parent E8; +94 authored game bytes, 2/2 local replay. Native proof. |
284B AnimationFile::clear() resource-retirement Boss |
Entire 284B/81-i386 native whole strict exact, real renderer file detach/texture release and allocator arrays/bytes retirement, all original 8 E8 and 8 HIGHLOW anchored. +284 game-authored bytes, 1/1 affected-only replay. Whole proof. |
| 922B AnimationFile spawn Boss whole strict exact | 922B/269-i386 full native original exact, actual seven visible args plus compiler-hidden AnimationHandle return, original lock/allocate/script/position/flag/render selection. 20 E8 and 14 HIGHLOW entirely verified. The 83B caller was retyped to the same actual original member and replayed 83/83 exact. +922 authored game bytes. Complete PE/COFF proof. |
| 83B particle AnimationFile spawn wrapper | Original 83B/30-i386 whole strict exact, mode 1 selects flag16, six incoming arguments passed to native 922B Animation file spawn with additional fixed flags; called four times from 2,884B particle Boss. +83 authored-game bytes. Whole original proof. |
| 57B original Animation interpolation forwarding | Native 57B/24-i386 whole strict exact, Animation +0x8C interpolator with mode8 and five original arguments, E8 to already exact 124B configuration; called twice in original 2,884B Boss. +57 authored game bytes, 2/2 local affected replay. Whole proof. |
| 124B Vector3 interpolation configuration | Whole original 124B/45-i386 with seven genuine E8 setter/Timer targets, original +0x30 current and +0x3C Timer, typed natural C++20 124/124 strict exact. +124 authored-game bytes; enclosing 2,884B Update remains source absent. Full proof. |
| 202B original Vector3 normalized geometry | Whole 202B/58-i386 three-component vector normalization/copy exact, two native E8 and real 0.01f epsilon HIGHLOW; +202 authored game bytes. Original full proof. |
| 200-particle polymorphic native group constructor | Whole 172B/46-i386 original game ctor and 49B/18-i386 generated deleting wrapper now strict exact under one real 0x1940-byte class with two 200-element Vector3 arrays. Original 0x56EC14 vtable and all 9 ctor E8/1 HIGHLOW independently audited. +172 authored-game bytes; generated wrappers uncredited. Whole original proof, 156B C++17 factory, 47B create/31B configuration, 92B virtual stop. |
| 1,486B rotated sprite corner Boss now whole exact | 1,486/1,486 original x86 exact with all 13 E8, nine native HIGHLOW and an authentic compiler-emitted +0x41 NOP from the post-Angle lexical scope. The separately exact 985B corner sibling remains unchanged. Complete strict proof. |
| Source-present, NONEXACT parents | Original 5,993B Animation Draw, 104B polygon wrapper, 3,111B Player main, and 555B Player movement. |
| Source-absent large parents | Original 12,140B Bullet extended command, 41,967B Enemy ECL opcode dispatcher, and 39,470B Animation VM update. Their exact callees are not parent-body credit. |
Exact original .rdata |
The 96B 2×3×4 quad corner table, 8B polygon widths (16.0f/32.0f) and 72B Player direction table each have attested original data bytes; none increases game .text coverage. Corner table, polygon scalars, Player data. |
| Whole-program result | Not linked or playable yet. Source mapping, canonical strict acceptance, original authorship credit, static data and runtime integration are different claims. |
Generated progress and the status reporter provide live authored totals. The current handoff records remaining work and local verification; the evidence index routes dated investigations without mixing historical counts into current status.
The pinned toolchain candidate is MSVC 19.44.35211 x86, Windows SDK 10.0.26100.0 and D3DX 9.29.952.8. Accepted units use explicit per-source profiles. These results do not establish executable-wide compiler flags, SDK or CRT identity.
Documentation and artifact-cleanup handoffs use diff/link checks and protected
product hashes. An unchanged native compiler-input graph needs no replay,
compiler, Ghidra or full CI run. Shared-header text edits can invalidate
pinned compiler receipt hashes: replay only the actual pre-edit receipt include
closure in that case. Use the gpt-web: commit prefix.
When code or infrastructure changes warrant broader checks, public CI needs Python 3.11+, with no original game or C++ compiler:
scripts/repo-python scripts/ci.pyDefault CI checks public-tree Python/JSON/TOML/shell syntax, private-artifact
exclusion, source-profile rules, ledger consistency and build configuration.
It needs no game, compiler, Ghidra or optional Python packages. Use
scripts/repo-python scripts/ci.py --full to add synthetic exact-oracle tests
when changing the comparator or its inputs. The historical
portable C++ semantic suite has been retired; retained tests
cover exact comparison and repository tools. Exact checkpoints require affected
native builds and complete strict replay. A specific unresolved behavior or ABI
question can use a temporary probe under .analysis/.
Private preflight for reconstruction changes is:
scripts/bootstrap-tools.sh
scripts/repo-python scripts/verify-target.py
scripts/repo-python scripts/report-reconstruction-status.py --summary
scripts/repo-python scripts/validate-tracking.py --require-targetOn a fresh private workspace, provision tools as described in
Tools, then run scripts/repo-python scripts/ghidra.py import once.
Every query re-attests the executable and complete mapped code section;
inventory refreshes never overwrite reviewed ledgers.
For source changes, derive the actual affected providers from captured include
closures and manifest dependencies. Build and replay only those units, with
individual unit commands or explicit --source filters. New exact acceptance
requires affected cold builds; see build and matching.
Oracatt/Touhou20 is pinned locally under
ignored _reference/Touhou20. Its target hash matches ours. Its v1.00c label
comes from embedded strings; our v1.00a identification follows the independent
hash registry and supplied package. Both observations are preserved in provenance.
The review records the repository-wide evidence audit, module dispositions, stale reports and independently verified absorption. Validated source diagnostics route further analysis; reference source, build layout and completion claims are not imported wholesale.
The function-by-function review is complete for all 6,945 indexed implementations, including one parser omission recovered during manual review. All 113 parser-gap files are manually reconciled. The final audit records coverage and evidence limits; nonexact implementations remain documented for further reconstruction.
- Current handoff
- Focused evidence index
- Architecture and target inventory
- Reconstruction workflow
- Independent oracles
- Build and strict matching
- Ghidra setup and attestation
- Tool routing
- Source ownership
- Semantic reconstruction policy
- Reference review
- Function-by-function reference review
- Complete reference review and final tooling batch
- Enemy movement, spawn and variable review
- Runtime invincibility launcher
- Verified knowledge base
- Roadmap
- Generated progress
- Agent rules
- Oracatt/Touhou20: reference reconstruction, source diagnostics and behavioral investigations that guide our independent, function-by-function review.
- N0zoM1z0/th095: reconstruction workflow, exact-oracle control plane, tracking conventions and README/progress layout.
MIT for this repository's original code and TH095-derived control plane. It grants no rights to the original game, downloaded tools or external reference material. Maintained prose and commit messages are in English; official names and original target evidence retain their original language.
