Skip to content

zWorld2: 90.1% match#58

Draft
JohnDeved wants to merge 226 commits intodbalatoni13:mainfrom
JohnDeved:zWorld2
Draft

zWorld2: 90.1% match#58
JohnDeved wants to merge 226 commits intodbalatoni13:mainfrom
JohnDeved:zWorld2

Conversation

@JohnDeved
Copy link
Copy Markdown
Contributor

@JohnDeved JohnDeved commented Mar 12, 2026

zWorld2 Translation Unit — 90.1% Match

This branch turns main/Speed/Indep/SourceLists/zWorld2 from a mostly scaffold-only / 0%-matched implementation state into a real decompilation pass that now reaches 90.1% .text match on GOWE69.

The report comment on this PR is the source of truth for before/after deltas: it shows hundreds of items in zWorld2 moving from 0.00% to matched or substantially matched, including 316 new matches on the latest cross-target report.

Current GOWE69 status

Metric Current
.text match 90.1%
Remaining bytes 13,802B
Matching functions 280 / 360

Main work in this branch

  • Implemented the largest missing road-navigation routines in WRoadNetwork.cpp, especially WRoadNav::UpdateOccludedPosition(bool)
  • Added real implementations across the entire jumbo TU: collider, collision, grid, trigger, world, pathfinder, road-network, and world-connection code
  • Matched or nearly matched many high-value helpers that were previously at 0.00%
  • Fixed missing globals, constructor bodies, inline placement, template emission, and vtable/layout issues needed for correct codegen
  • Added cross-target compatibility guards needed to keep CI green on GameCube, milestone, and PS2 builds

Notable matching/layout fixes

  • Listable::List reserve behavior adjusted to match original codegen used by zWorld2
  • AStarNode constructor / helpers moved inline to match original emission
  • IVehicleAI platform-specific layout restored for A124 where needed
  • CARP::EventList / EventStaticData usage qualified to avoid jumbo-build header ambiguity
  • Platform/compiler-specific math and allocator guards added for MSVC and PS2

Scope

This PR touches the full zWorld2 jumbo build and related shared headers needed to make the unit compile and match correctly. The attached report comment captures the exact per-platform gains, broken matches, and regressions for follow-up.

JohnDeved and others added 30 commits March 10, 2026 13:43
Skills moved from tools/skills/ to .github/skills/ and scripts
moved from scripts/ to tools/ - update all references accordingly.
- decomp-context.py: scope source output to function line range instead of full file; add Ghidra error diagnostics with stderr reporting and --ghidra-check flag
- tools/find-symbol.py: new CLI symbol finder to replace clangd workspace/symbol for checking existing definitions before declaring new types
- refiner/SKILL.md: new skill for resolving stubborn instruction mismatches with systematic lateral strategies
- AGENTS.md: document new tools, expand Matching Tips with branch/stack/vtable/register/inline patterns, add Discovered Matching Patterns section with entry template
- lookup/SKILL.md: replace clangd instructions with find-symbol.py
- scaffold/SKILL.md: fix typos, replace clangd reference, add jumbo unit identification guidance
- execute/SKILL.md: fix section numbering gap (1a/1c -> 1a/1b), link skill files in agent type list
- implement/SKILL.md: replace cat command with Read tool guidance
…ation

* fix: update stale tool paths in AGENTS.md

Skills moved from tools/skills/ to .github/skills/ and scripts
moved from scripts/ to tools/ - update all references accordingly.

* fix to work with "ghidra-cli" and "ghidra" commands

* Improve AI workflow tooling and documentation

- decomp-context.py: scope source output to function line range instead of full file; add Ghidra error diagnostics with stderr reporting and --ghidra-check flag
- tools/find-symbol.py: new CLI symbol finder to replace clangd workspace/symbol for checking existing definitions before declaring new types
- refiner/SKILL.md: new skill for resolving stubborn instruction mismatches with systematic lateral strategies
- AGENTS.md: document new tools, expand Matching Tips with branch/stack/vtable/register/inline patterns, add Discovered Matching Patterns section with entry template
- lookup/SKILL.md: replace clangd instructions with find-symbol.py
- scaffold/SKILL.md: fix typos, replace clangd reference, add jumbo unit identification guidance
- execute/SKILL.md: fix section numbering gap (1a/1c -> 1a/1b), link skill files in agent type list
- implement/SKILL.md: replace cat command with Read tool guidance

* Make non-owning VecHashMap clear without deletes
4 remaining mismatches are register allocation (r0<->r9 swap) in
the flags byte-read expression. DWARF matches perfectly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ResetShortcuts: 0xFF sentinel
- WWorld::Unloader: store order swap
- GetSegmentProfile: || short-circuit
- GetSegmentTrafficLaneInd: test-before-decrement
- InitFromOtherNav: SetLaneInd store order
- WRoadNav ctor: bOccludedFromBehind last
- GetGrowSize: Max arg order

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New implementations:
- WTrigger::WTrigger(Matrix4, Vector3, EventList, uint) (78.5%)
- WTrigger::FireEvents (83.7%)
- WRoadNav::GetShortcutNumber (100%)

Fixed near-matches:
- ResetShortcuts: 0xFF sentinel (100%)
- InitAtPath: store order swap (100%)
- InitAtPoint: store order swap

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…NthTrafficLaneFromCurb + WCollisionTri::GetNormal

- WWorld::Open (244B) - 99.7% match (store scheduling artifact)
- WCollisionPack::Resolve - fixed store order to 100%
- WRoadProfile::GetNthTrafficLaneFromCurb (284B) - 76.3%
- WCollisionTri::GetNormal inline added
- CARP.h: namespace CARP with ResolveTagReferences
- UGroup.hpp: GroupCountType, GroupLocateFirst declarations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix UNormal(Vector3*) to use fFaceValid directly instead of
OnValidFace() to match original DWARF inline structure. Reorder
else branch assignments (z, x, y) to match original store order.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ck new/delete

- Add WCollisionTriList destructor (inline, calls clear_all)
- Add WCollisionTriList::clear_all declaration and implementation
- Add WCollisionTriBlock operator new/delete using gFastMem
- WCollider::~WCollider improved to 98.6%
- clear_all at 85.9% (compiler null guard artifact)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…target

Move fDynElems = nullptr outside the if-block in WGridNode::ShutDown
to match original branch target behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ines, GMarker struct

- WRoadNetwork::ResolveShortcuts: iterate race shortcuts, set road nShortcut,
  flag segments with shortcut bit
- Add GetSegRoadInd inline to WRoadNetwork
- Add GetRoadInd inline to WRoadNav
- Fill in GMarker struct with position/direction and inline getters
- Progress: 26.8% (137/360)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Init function with mapGroup null/non-null branches
- Add WGridManagedDynamicElem::Init() static inline
- Add TrackOBB struct and GetNumTrackOBBs/GetTrackOBB declarations
- Fix pre-existing build errors: GMarker ctor, kNavType_Traffic enum

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… (100%)

- WRoadNetwork::Init: allocate network, load road data from UGroup,
  resolve barriers/shortcuts/race segments. 98.5% match (register alloc).
- WCollisionAssets::Init: 100% match (396B) via background agent.
- Add UGroup inline helpers: GroupLocate, DataLocate, GroupBegin/End, etc.
- Add WRoadNetworkInfo struct to WRoadElem.h
- Progress: 27.9% (137/360)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…::Admissible, WGrid::Init

- WRoadNetwork::GetLinePointIntersect (392B) - 100% match
- WTriggerManager::Update (560B) - 100% match
- WGrid::Init (560B) - via background agent
- AStarSearch::Admissible (464B) - 74.2% (switch binary search structure)
- Added WRoadSegment::IsOneWay inline
- Added WGridNode allocation support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass operator+ results directly to BuildSplineEx as temporaries
instead of assigning back to start_control/end_control. This
produces the correct frame size (0xC8) by preventing UVector3
stack slot reuse.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ine, ChooseAudioAttributes, CreateObject; fix template params

New functions (100% match):
- PathFinder::PathFinder (248B)
- PathFinder::~PathFinder (344B)
- WGrid::Init (560B)
- ChooseAudioAttributes (452B)

New functions (near-match):
- WRoadNetwork::BuildSegmentSpline (688B, 99.8%)
- WCollisionAssets::CreateObject (684B)

Fixes:
- CookieTrail template: std::size_t -> int (fixes symbol mangling)
- UTL::Vector/FixedVector template: unsigned int -> int (fixes mangling)
- WTriggerManager::SubmitForFire byte access order swap (99.4% -> 99.6%)

Progress: 31.6% (141/360 functions)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add DetermineVehicleHalfWidth() to WRoadNetwork.cpp
- Add GRaceStatus::IsDragRace() static inline to GRaceStatus.h
- Add includes for IBody, IVehicle, VehicleSystem, AIVehicle

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both WorldEffectConn::WorldEffectConn and WorldEffectConn::~WorldEffectConn
are now 100% matching.

Key findings:
- AudioEvent vtable has pure virtual entries at positions 2 and 3
- Dtor calls AudioEvent::Stop() (entry 2), not delete
- Switch statement generates correct beq-forward branch pattern
- Member zeroing order: mPaused, mSilent, mAudioEvent

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r/dtor 100%, DetermineVehicleHalfWidth 100%

Fixes to 100%:
- WCollider::Validate (24B) - normalize bool to 0/1
- WCollisionAssets::Shutdown (112B) - inline trigger/grid cleanup
- WCollisionArticle::Resolve (136B) - loop variable inside loop, parenthesized offset
- WorldEffectConn ctor (452B) - switch vs if-else for owner class check
- WorldEffectConn dtor (228B) - virtual Stop() call instead of delete

New:
- WRoadNav::DetermineVehicleHalfWidth (336B) - 100% match
- GRaceStatus::IsDragRace inline added

Near-match improvements:
- UpdateLaneChange (99.5% -> 99.6%) - store reorder
- GetAttachedDirectionalSegment (67.5% -> 71.9%) - XOR flag check

Progress: 32.3% (146/360 functions)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JohnDeved and others added 16 commits March 12, 2026 13:38
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix TAttrib usage pattern (default construct + assign), comparison order,
novideo variable, and non-inlined TAttrib::Get.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tructor fixes

- Implement WRoadNav::UpdateOccludedPosition (4368B, 58.7% match)
- Fix SubSystem constructor body in SimSubSystem.h
- Fix Factory::Prototype constructor (add mTail=mHead) in UCOM.h
- Add missing globals: _Physics_System_WRoadNetwork, _PathFinder,
  bChunkLoaderWGrid, WSurface::kNull, WorldConn globals, Tweak_colliderDraws
- Add UMath::Lerp(Vector2) and UMath::ScaleAdd(Vector2) inlines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rload

Remove ResetDriveToNav(Vector3&) from IVehicleAI - this overload only
exists in the PS2 alpha build, not the GC release. This fixes the vtable
offset mismatch (all methods were shifted by +8 bytes), matching
FetchAvoidables and other IVehicleAI virtual calls.

Also improved UpdateOccludedPosition apex section and occlusion logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nch fixes

- Fix kFloatScaleUp from IntAsFloat(0x7E800000) to IntAsFloat(0x00800000) in UVectorMath.h
- Fix kFloatScaleDown to 1.0f / kFloatScaleUp (runtime computation)
- Remove template<> from Listable _mTable definition to emit standalone copy
- Fix TimeToClosestApproach branch inversion (if b >= 0.001f -> if b < 0.001f)
- Fix set<short> -> set<unsigned short> in WRoadNetwork.cpp
- Remove VU0_v4length non-inline forward declaration in UMath.h
- Inline EmitterGroup::SetIntensity in EmitterSystem.h
- Pre-compute cx/cz locals in ClampCookieCentres for matching instruction schedule

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…perand order

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move AStarNode::AStarNode(parent, road_node, ...), GetParent(), and
operator new() from out-of-line definitions in WPathFinder.cpp to
inline definitions in WPathFinder.h. The original binary inlines
these functions at call sites rather than emitting standalone copies.
Keeps operator delete out-of-line as the original has it standalone.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…athy rename

Remove 'using CARP::EventList' directive from WTrigger.h that caused
ambiguity in zSim jumbo build. Use CARP:: qualified names throughout
WTrigger.h, WTrigger.cpp, and Event.h instead.

Fix AIVehicle.cpp reference to kPathPathy -> kPathChopper to match
the corrected EPathType enum values from DWARF.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@decomp-dev
Copy link
Copy Markdown

decomp-dev bot commented Mar 12, 2026

Report for SLES-53558-A124 (b2a3871 - 1f59148)

📈 Matched code: 8.96% (+0.84%, +32592 bytes)

✅ 278 new matches
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::DeleteRefs(WTrigger const *) +1756 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::Destroy(WCollider *) +1468 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WorldConn::Server::UnlockID(unsigned int) +1448 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WGridManagedDynamicElem::AddElem(UMath::Vector4 const *, UMath::Vector4 const *, WGridNode_ElemType, unsigned int) +1100 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WCollider *>, _Select1st<pair<unsigned int const, WCollider *> >, less<unsigned int>, UTL::Std::Allocator<WCollider *, _type_map> >::_M_insert(_Rb_tree_node_base *, _Rb_tree_node_base *, pair<unsigned int const, WCollider *> const &) +852 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WorldConn::Server::Body *>, _Select1st<pair<unsigned int const, WorldConn::Server::Body *> >, less<unsigned int>, UTL::Std::Allocator<WorldConn::Server::Body *, _type_WorldConnServerMap> >::_M_insert(_Rb_tree_node_base *, _Rb_tree_node_base *, pair<unsigned int const, WorldConn::Server::Body *> const &) +852 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned short, unsigned short, _Identity<unsigned short>, less<unsigned short>, UTL::Std::Allocator<unsigned short, _type_set> >::_M_insert(_Rb_tree_node_base *, _Rb_tree_node_base *, unsigned short const &) +836 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::WCollider(WCollider::eColliderShape, unsigned int, unsigned int) +752 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::FetchAvoidables(IBody **, int) const +732 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 vector<WCollisionInstance const *, UTL::Std::Allocator<WCollisionInstance const *, _type_WCollisionWarnVector> >::insert(WCollisionInstance const **, unsigned int, WCollisionInstance const *const &) +544 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 vector<WCollisionObject const *, UTL::Std::Allocator<WCollisionObject const *, _type_WCollisionVector> >::insert(WCollisionObject const **, unsigned int, WCollisionObject const *const &) +544 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::Reset +496 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::GetLinePointIntersect(UMath::Vector3 const &, UMath::Vector3 const &, UMath::Vector3 const &, UMath::Vector3 &, bool) +492 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WorldEffectConn::WorldEffectConn(Sim::ConnectionData const &, WorldConn::Pkt_Effect_Open const *) +460 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetInstanceList(WCollisionInstanceCacheList &, UMath::Vector4 const *) +444 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WCollider *>, _Select1st<pair<unsigned int const, WCollider *> >, less<unsigned int>, UTL::Std::Allocator<WCollider *, _type_map> >::insert_unique(_Rb_tree_iterator<pair<unsigned int const, WCollider *>, pair<unsigned int const, WCollider *> &, pair<unsigned int const, WCollider *> *>, pair<unsigned int const, WCollider *> const &) +440 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WorldConn::Server::Body *>, _Select1st<pair<unsigned int const, WorldConn::Server::Body *> >, less<unsigned int>, UTL::Std::Allocator<WorldConn::Server::Body *, _type_WorldConnServerMap> >::insert_unique(_Rb_tree_iterator<pair<unsigned int const, WorldConn::Server::Body *>, pair<unsigned int const, WorldConn::Server::Body *> &, pair<unsigned int const, WorldConn::Server::Body *> *>, pair<unsigned int const, WorldConn::Server::Body *> const &) +440 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionAssets::~WCollisionAssets(void) +420 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<FireOnExitRec, FireOnExitRec, _Identity<FireOnExitRec>, less<FireOnExitRec>, allocator<FireOnExitRec> >::insert_unique(FireOnExitRec const &) +404 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WCollider *>, _Select1st<pair<unsigned int const, WCollider *> >, less<unsigned int>, UTL::Std::Allocator<WCollider *, _type_map> >::insert_unique(pair<unsigned int const, WCollider *> const &) +360 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned short, unsigned short, _Identity<unsigned short>, less<unsigned short>, UTL::Std::Allocator<unsigned short, _type_set> >::insert_unique(unsigned short const &) +360 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<unsigned int, pair<unsigned int const, WorldConn::Server::Body *>, _Select1st<pair<unsigned int const, WorldConn::Server::Body *> >, less<unsigned int>, UTL::Std::Allocator<WorldConn::Server::Body *, _type_WorldConnServerMap> >::insert_unique(pair<unsigned int const, WorldConn::Server::Body *> const &) +360 0.00% 100.00%
main/Speed/Indep/SourceLists/zAI vector<WCollisionTriBlock *, UTL::Std::Allocator<WCollisionTriBlock *, _type_WCollisionVector> >::_M_insert_aux(WCollisionTriBlock **, WCollisionTriBlock *const &) +344 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 vector<WCollisionInstance const *, UTL::Std::Allocator<WCollisionInstance const *, _type_WCollisionWarnVector> >::_M_insert_aux(WCollisionInstance const **, WCollisionInstance const *const &) +344 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 vector<WTrigger *, UTL::Std::Allocator<WTrigger *, _type_vector> >::_M_insert_aux(WTrigger **, WTrigger *const &) +344 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::Create(unsigned int, WCollider::eColliderShape, unsigned int, unsigned int) +308 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WGrid::Shutdown +268 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::DetermineVehicleHalfWidth +264 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionAssets::UnLoadCollisionPack(bChunk *) +240 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WorldEffectConn::~WorldEffectConn(void) +240 0.00% 100.00%

...and 248 more new matches

📈 176 improvements in unmatched items
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::Update(float) +2092 0.00% 98.54%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::HolePunchAvoidables(NavCookie *, int, float, float) +1968 0.00% 70.11%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::GetNextTraffic(UMath::Vector3 const &, float &, char &, bool &) +1680 0.00% 72.71%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::ChangeDragDecision(int) +1539 0.00% 84.61%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetTriList(WCollisionInstanceCacheList const &, UMath::Vector3 const &, float, WCollisionTriList &) +1498 0.00% 57.65%
main/Speed/Indep/SourceLists/zWorld2 WorldEffectConn::Update(float) +1445 0.00% 73.88%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::FindClosestSegmentInd(UMath::Vector3 const &, UMath::Vector3 const &, float, UMath::Vector3 &, float &) +1426 0.00% 51.84%
main/Speed/Indep/SourceLists/zWorld2 World_OneShotEffect(Sim::Packet*) +1426 0.00% 66.04%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::GetNextOffset(UMath::Vector3 const &, float &, char &, bool &) +1272 0.00% 70.54%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::SetBoundPos(WRoadSegment const &, float, bool) +1271 0.00% 71.26%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInTriStrip(UMath::Vector3 const &, WCollisionStripSphere const *, WCollisionStrip const *, WCollisionTri &) +1242 0.00% 64.99%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::UpdateOccludedPosition(bool) +1176 0.00% 27.30%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::ProcessSRB(IRigidBody *, float) +1056 0.00% 91.11%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::PrivateIncNavPosition(float, UMath::Vector3 const &) +1026 0.00% 92.95%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInTriStrip(UMath::Matrix4 const &, UMath::Vector3 const &, WCollisionStripSphere const *, WCollisionStrip const *, float &, WCollisionTri &) +981 0.00% 63.74%
main/Speed/Indep/SourceLists/zWorld2 AStarSearch::Service(float) +980 0.00% 51.82%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::ProcessRB(IRigidBody *, float) +979 0.00% 90.71%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::CheckCollideSRB(IRigidBody const *, WTrigger const *, float) const +956 0.00% 86.61%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::GetRightMostTrafficEntrance(int, int) +953 0.00% 78.71%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInCInst(UMath::Vector3 const &, WCollisionInstance const &, WCollisionTri &, float &) +944 0.00% 65.05%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::CheckHitWorld(UMath::Vector4 const *, WCollisionMgr::WorldCollisionInfo &, unsigned int) +925 0.00% 48.22%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::GetIntersectingTriggers(UMath::Vector3 const &, float, WTriggerList *) const +916 0.00% 97.54%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::UpdateCookieTrail(float) +915 0.00% 69.74%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::Collide(Dynamics::Collision::Geometry *, WCollisionBarrierList const *, WCollisionMgr::ICollisionHandler *, void *, bool) +912 0.00% 61.48%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::CheckCollideRB(IRigidBody const *, WTrigger const *, float) const +909 0.00% 87.10%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::ResolveBarriers +871 0.00% 66.02%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetBarrierList(WCollisionBarrierList &, WCollisionInstanceCacheList const &, UMath::Vector3 const &, float) +858 0.00% 57.69%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetBarrierNormal(WCollisionInstanceCacheList const &, UMath::Vector4 const *, WCollisionMgr::WorldCollisionInfo &) +845 0.00% 74.17%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::Init +835 0.00% 94.54%
main/Speed/Indep/SourceLists/zWorld2 _Rb_tree<FireOnExitRec, FireOnExitRec, _Identity<FireOnExitRec>, less<FireOnExitRec>, allocator<FireOnExitRec> >::_M_insert(_Rb_tree_node_base *, _Rb_tree_node_base *, FireOnExitRec const &) +835 0.00% 94.48%

...and 146 more improvements in unmatched items

📉 3 regressions in unmatched items
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zAttribSys Attrib::Class::RemoveCollection(Attrib::Collection *) -2 91.28% 91.14%
main/Speed/Indep/SourceLists/zAttribSys Attrib::Database::RemoveClass(Attrib::Class const *) -2 93.66% 93.53%
main/Speed/Indep/SourceLists/zSim global constructors keyed to OBB::OBB(void) 0 1.52% 1.51%

Report for GOWE69 (b2a3871 - 1f59148)

📈 Matched code: 15.70% (+1.64%, +64948 bytes)
📈 Matched data: 0.56% (+0.00%, +4 bytes)

✅ 313 new matches
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInTriStrip(UMath::Vector3 const &, WCollisionStripSphere const *, WCollisionStrip const *, WCollisionTri &) +2284 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::vector<WCollisionBarrierListEntry, UTL::Std::Allocator<WCollisionBarrierListEntry, _type_WCollisionVector> >::_M_fill_insert(WCollisionBarrierListEntry *, unsigned int, WCollisionBarrierListEntry const &) +1964 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInTriStrip(UMath::Matrix4 const &, UMath::Vector3 const &, WCollisionStripSphere const *, WCollisionStrip const *, float &, WCollisionTri &) +1716 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::PrivateIncNavPosition(float, UMath::Vector3 const &) +1276 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WGridManagedDynamicElem::AddElem(UMath::Vector4 const *, UMath::Vector4 const *, WGridNode_ElemType, unsigned int) +1244 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInCInst(UMath::Vector3 const &, WCollisionInstance const &, WCollisionTri &, float &) +1204 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::IncLane(int) +976 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::FetchAvoidables(IBody **, int) const +804 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WGrid::FindNodesBox(UMath::Vector4 const *, UTL::Vector<unsigned int, 16> &) const +768 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::EmptyLists(unsigned int) +740 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::PullOver +736 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::BuildSegmentSpline(WRoadSegment const &, USpline &) +688 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::vector<WCollisionInstance const *, UTL::Std::Allocator<WCollisionInstance const *, _type_WCollisionWarnVector> >::_M_fill_insert(WCollisionInstance const **, unsigned int, WCollisionInstance const *const &) +624 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::vector<WCollisionObject const *, UTL::Std::Allocator<WCollisionObject const *, _type_WCollisionVector> >::_M_fill_insert(WCollisionObject const **, unsigned int, WCollisionObject const *const &) +624 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::_Rb_tree<unsigned int, _STL::pair<unsigned int const, WCollider *>, _STL::_Select1st<_STL::pair<unsigned int const, WCollider *> >, _STL::less<unsigned int>, UTL::Std::Allocator<WCollider *, _type_map> >::insert_unique(_STL::_Rb_tree_iterator<_STL::pair<unsigned int const, WCollider *>, _STL::_Nonconst_traits<_STL::pair<unsigned int const, WCollider *> > >, _STL::pair<unsigned int const, WCollider *> const &) +620 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::_Rb_tree<unsigned int, _STL::pair<unsigned int const, WCollisionObject *>, _STL::_Select1st<_STL::pair<unsigned int const, WCollisionObject *> >, _STL::less<unsigned int>, UTL::Std::Allocator<WCollisionObject *, _type_map> >::insert_unique(_STL::_Rb_tree_iterator<_STL::pair<unsigned int const, WCollisionObject *>, _STL::_Nonconst_traits<_STL::pair<unsigned int const, WCollisionObject *> > >, _STL::pair<unsigned int const, WCollisionObject *> const &) +620 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 _STL::_Rb_tree<unsigned int, _STL::pair<unsigned int const, WorldConn::Server::Body *>, _STL::_Select1st<_STL::pair<unsigned int const, WorldConn::Server::Body *> >, _STL::less<unsigned int>, UTL::Std::Allocator<WorldConn::Server::Body *, _type_WorldConnServerMap> >::insert_unique(_STL::_Rb_tree_iterator<_STL::pair<unsigned int const, WorldConn::Server::Body *>, _STL::_Nonconst_traits<_STL::pair<unsigned int const, WorldConn::Server::Body *> > >, _STL::pair<unsigned int const, WorldConn::Server::Body *> const &) +620 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::ClearLists(unsigned int) +580 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::~WCollider(void) +576 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetObjectList(WCollisionObjectList &, UMath::Vector3 const &, float) +576 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetInstanceList(WCollisionInstanceCacheList &, UMath::Vector3 const &, float, bool) +572 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollider::WCollider(WCollider::eColliderShape, unsigned int, unsigned int) +564 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WWorldMath::MakeSegSpaceMatrix(UMath::Vector3 const &, UMath::Vector3 const &, UMath::Matrix4 &) +564 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WGrid::Init(UGroup const *) +560 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::Update(float) +560 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetInstanceList(WCollisionInstanceCacheList &, UMath::Vector4 const *) +544 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::Reset +532 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WWorldPos::Update(UMath::Vector3 const &, UMath::Vector4 &, bool, WCollider const *, bool) +532 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionPack::Resolve(UGroup const *, unsigned int) +492 0.00% 100.00%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetWorldHeightAtPointRigorous(UMath::Vector3 const &, float &, UMath::Vector3 *) +476 0.00% 100.00%

...and 283 more new matches

📈 91 improvements in unmatched items
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetTriList(WCollisionInstanceCacheList const &, UMath::Vector3 const &, float, WCollisionTriList &) +2943 0.00% 99.29%
main/Speed/Indep/SourceLists/zWorld2 WGrid::FindNodes(UMath::Vector4 const *, UTL::Vector<unsigned int, 16> &) const +2614 0.00% 75.66%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::UpdateOccludedPosition(bool) +2482 0.00% 56.83%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetBarrierList(WCollisionBarrierList &, WCollisionInstanceCacheList const &, UMath::Vector3 const &, float) +2297 0.00% 93.11%
main/Speed/Indep/SourceLists/zWorld2 World_OneShotEffect(Sim::Packet*) +2085 0.00% 89.28%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::HolePunchAvoidables(NavCookie *, int, float, float) +2034 0.00% 68.27%
main/Speed/Indep/SourceLists/zWorld2 WorldEffectConn::Update(float) +2034 0.00% 95.60%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::FindClosestSegmentInd(UMath::Vector3 const &, UMath::Vector3 const &, float, UMath::Vector3 &, float &) +2031 0.00% 81.28%
main/Speed/Indep/SourceLists/zWorld2 AStarSearch::Service(float) +1775 0.00% 86.18%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::GetNextTraffic(UMath::Vector3 const &, float &, char &, bool &) +1774 0.00% 73.34%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::GetNextOffset(UMath::Vector3 const &, float &, char &, bool &) +1502 0.00% 85.18%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetInstanceListGuts(UTL::Vector<unsigned int, 16> const &, WCollisionInstanceCacheList &, UMath::Vector4 const *) +1494 0.00% 93.20%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::ChangeDragDecision(int) +1420 0.00% 85.16%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::SnapToSelectableLane(float, int, char) +1405 0.00% 67.95%
main/Speed/Indep/SourceLists/zWorld2 WRoadNetwork::ResolveBarriers +1403 0.00% 94.35%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::FindFaceInCInst(UMath::Matrix4 const &, UMath::Vector3 const &, WCollisionInstance const &, WCollisionTri &, float &) +1394 0.00% 97.13%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::GetIntersectingTriggers(UMath::Vector3 const &, float, WTriggerList *) const +1361 0.00% 97.82%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::SetBoundPos(WRoadSegment const &, float, bool) +1356 0.00% 73.43%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::ProcessSRB(IRigidBody *, float) +1355 0.00% 95.21%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::CheckHitWorld(UMath::Vector4 const *, WCollisionMgr::WorldCollisionInfo &, unsigned int) +1354 0.00% 84.45%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::Collide(Dynamics::Collision::Geometry *, WCollisionBarrierList const *, WCollisionMgr::ICollisionHandler *, void *, bool) +1326 0.00% 94.18%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::ProcessRB(IRigidBody *, float) +1269 0.00% 95.32%
main/Speed/Indep/SourceLists/zWorld2 WWorldPos::FindClosestFace(WCollisionTriList const &, UMath::Vector3 const &, bool) +1177 0.00% 95.91%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::CookieTrailCurvature(UMath::Vector3 const &, UMath::Vector3 const &) +1104 0.00% 86.03%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetInstanceListGuts(UTL::Vector<unsigned int, 16> const &, WCollisionInstanceCacheList &, UMath::Vector3 const &, float, bool) +1042 0.00% 97.24%
main/Speed/Indep/SourceLists/zWorld2 AStarSearch::AStarSearch(WRoadNav *, UMath::Vector3 const *, UMath::Vector3 const *, char const *) +1015 0.00% 80.85%
main/Speed/Indep/SourceLists/zWorld2 .bss +995 0.00% 78.73%
main/Speed/Indep/SourceLists/zWorld2 WTriggerManager::CheckCollideSRB(IRigidBody const *, WTrigger const *, float) const +986 0.00% 94.51%
main/Speed/Indep/SourceLists/zWorld2 WRoadNav::ChangeDragLanes(int) +984 0.00% 76.17%
main/Speed/Indep/SourceLists/zWorld2 WCollisionMgr::GetBarrierNormal(WCollisionInstanceCacheList const &, UMath::Vector4 const *, WCollisionMgr::WorldCollisionInfo &) +920 0.00% 94.28%

...and 61 more improvements in unmatched items

📉 7 regressions in unmatched items
Unit Item Bytes Before After
main/Speed/Indep/SourceLists/zSim .bss -470 32.73% 26.87%
main/Speed/Indep/SourceLists/zMisc __static_initialization_and_destruction_0 -27 30.08% 28.19%
main/Speed/Indep/SourceLists/zEAXSound __static_initialization_and_destruction_0 -9 0.99% 0.89%
main/Speed/Indep/SourceLists/zEcstasy IsSunInFrustrum(eView*) -9 61.65% 58.02%
main/Speed/Indep/SourceLists/zAnim __static_initialization_and_destruction_0 -5 29.43% 28.73%
main/Speed/Indep/SourceLists/zMisc Hermes::System::RemovePortMessage(unsigned long long) -3 94.89% 94.74%
main/Speed/Indep/SourceLists/zWorld CarRenderInfo::CarRenderInfo(RideInfo *) 0 25.96% 25.95%

Report for EUROPEGERMILESTONE (b2a3871 - 1f59148)

No changes

JohnDeved and others added 3 commits March 12, 2026 19:53
Guard wwfabs() inline asm with __GNUC__ for MSVC compatibility.
Guard ASinr() with ifndef EA_PLATFORM_PLAYSTATION2 since VU0_ASin
is only defined in the non-PS2 branch of UVectorMath.h.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sionTri MSVC compat

- Add bMalloc(unsigned int, int) overload on PS2 to handle implicit conversion
- Provide asinf-based ASinr fallback for PS2 (VU0_ASin not available)
- Guard WCollisionTri clear_all() with _MSC_VER for index-based loop on MSVC
  while keeping pointer-based loop on GCC to preserve GC codegen

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wwfabs() used __GNUC__ guard but PS2 EE-GCC is also GCC, and fabs is
back to the ternary on PS2/MIPS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JohnDeved JohnDeved changed the title zWorld2: 90.1% match — implement UpdateOccludedPosition, scaffold all 17 source files zWorld2: 90.1% match Mar 12, 2026
JohnDeved and others added 8 commits March 12, 2026 20:20
…one SubSystem ctor

- Restore IVehicleAI::ResetDriveToNav(Vector3&) under EA_BUILD_A124 to keep
  the PS2 interface/vtable layout used by zAI
- Keep the filled-in Sim::SubSystem constructor for non-milestone builds, but
  preserve the old milestone constructor shape to avoid cross-target drift
- Verified zWorld2 remains at 90.1% after both header guards

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…target

- Preserve the current Listable::List reserve path for non-milestone builds, but
  restore the older FixedVector-based shape on milestone builds to reduce shared
  container drift outside zWorld2
- Keep the xz-specific DistanceSquarexz helper on GameCube/other builds, but use
  the old PS2 helper body to avoid the reported PS2 AITrafficManager regression
- Verified zWorld2 remains at 90.1% after both guards

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… types on MSVC builds

MSVC decorates non-type template parameters with their types. Keep the current
int-based UTLVector templates for GameCube/other builds where zWorld2 now
matches, but restore the original unsigned/size_t parameter types on milestone
builds to reduce cross-target symbol drift.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e helpers

- Skip the zWorld2-driven Factory::Prototype mTail assignment on milestone builds
- Keep the newer bVector2 copy/assignment helpers on GameCube/other builds, but
  preserve the older milestone behavior to avoid broad MSVC object drift
- Verified zWorld2 remains at 90.1% after both milestone-only fences

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removing local VU0_v4scale/VU0_v4lengthxyz declarations from UMath.h avoids
shadowing the UVectorMath inline helpers. That restores the original
VU0_v4lengthsquarexyz + VU0_sqrt codegen in zSim without changing zWorld2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove shadowing VU0_v4scale/VU0_v4lengthxyz declarations from UMath.h so
  zSim OBB::SphereVsSphere uses the original lengthsquarexyz + sqrt sequence
- Restore UCrc32 as a class (not struct) so MSVC milestone decorated names match
  the original symbols again
- Verified zWorld2 stays at 90.1% and OBB::SphereVsSphere returns to 100%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the outstanding PR merge conflict in WCollision.h while preserving the zWorld2 collision declarations and pulling in upstream header updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dbalatoni13
Copy link
Copy Markdown
Owner

dbalatoni13 commented Mar 13, 2026

Clean up the forward declarations of structs; and those of functions (if they are not defined inside the same file). By this I mean that they should be in the correct header and included into the .cpp file. Investigate whether structs are defined in the right file according to line info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants