Draft
Conversation
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>
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>
Report for SLES-53558-A124 (b2a3871 - 1f59148)📈 Matched code: 8.96% (+0.84%, +32592 bytes) ✅ 278 new matches
...and 248 more new matches 📈 176 improvements in unmatched items
...and 146 more improvements in unmatched items 📉 3 regressions in unmatched items
Report for GOWE69 (b2a3871 - 1f59148)📈 Matched code: 15.70% (+1.64%, +64948 bytes) ✅ 313 new matches
...and 283 more new matches 📈 91 improvements in unmatched items
...and 61 more improvements in unmatched items 📉 7 regressions in unmatched items
Report for EUROPEGERMILESTONE (b2a3871 - 1f59148)No changes |
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>
…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>
…r2 inline helpers" This reverts commit ea27102.
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>
Owner
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zWorld2 Translation Unit — 90.1% Match
This branch turns
main/Speed/Indep/SourceLists/zWorld2from a mostly scaffold-only / 0%-matched implementation state into a real decompilation pass that now reaches 90.1%.textmatch on GOWE69.The report comment on this PR is the source of truth for before/after deltas: it shows hundreds of items in
zWorld2moving from 0.00% to matched or substantially matched, including 316 new matches on the latest cross-target report.Current GOWE69 status
.textmatchMain work in this branch
WRoadNetwork.cpp, especiallyWRoadNav::UpdateOccludedPosition(bool)0.00%Notable matching/layout fixes
Listable::Listreserve behavior adjusted to match original codegen used byzWorld2AStarNodeconstructor / helpers moved inline to match original emissionIVehicleAIplatform-specific layout restored for A124 where neededCARP::EventList/EventStaticDatausage qualified to avoid jumbo-build header ambiguityScope
This PR touches the full
zWorld2jumbo 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.