Add Audit Plan for Ambiguous Path Handling

- Introduced a new audit plan detailing the "Ambiguous Path Handling" feature, including three parallel matching algorithm implementations (two in Rust and one in Lua) and their integration with the Reconciler.
- Documented findings related to scoring discrepancies between Lua and Rust implementations, including fixes for stale comments, scoring granularity for Tags/Attributes, and performance improvements in cost computation.
- Enhanced the `trueEquals` function to support fuzzy equality for additional types (UDim, UDim2, NumberRange, Rect, NumberSequence, ColorSequence) with corresponding unit tests to ensure accuracy.

These changes aim to improve the reliability and performance of the matching algorithms while ensuring consistency across implementations.
This commit is contained in:
Joe 2026-02-19 00:02:41 -06:00
parent 7e0538b9f5
commit 69f0b9fd63
4 changed files with 517 additions and 4 deletions

View file

@ -416,9 +416,9 @@ matchChildren = function(
virtualInstances: VirtualInstances,
parentVirtualId: string?,
parentStudioInstance: Instance?,
depth: number?
_depth: number?
): MatchResult
depth = depth or 0
local depth = _depth or 0
if parentVirtualId and parentStudioInstance then
local pc = session.matchCache[parentVirtualId]
if pc then
@ -430,6 +430,7 @@ matchChildren = function(
end
local matched: { MatchPair } = {}
local matchedCosts: { number? } = {}
local matchedV: { [number]: boolean } = {}
local matchedS: { [number]: boolean } = {}
@ -476,6 +477,7 @@ matchChildren = function(
virtualId = virtualChildren[vi],
studioInstance = studioChildren[si],
})
table.insert(matchedCosts, nil)
matchedV[vi] = true
matchedS[si] = true
continue
@ -590,6 +592,7 @@ matchChildren = function(
virtualId = virtualChildren[pair.vi],
studioInstance = studioChildren[pair.si],
})
table.insert(matchedCosts, pair.cost)
matchedV[pair.vi] = true
matchedS[pair.si] = true
end
@ -613,8 +616,13 @@ matchChildren = function(
end
local totalCost = 0
for _, pair in ipairs(matched) do
totalCost += computePairCost(session, pair.virtualId, pair.studioInstance, virtualInstances, math.huge, depth)
for i, pair in ipairs(matched) do
local precomputed = matchedCosts[i]
if precomputed ~= nil then
totalCost += precomputed
else
totalCost += computePairCost(session, pair.virtualId, pair.studioInstance, virtualInstances, math.huge, depth)
end
end
totalCost += (#unmatchedVirtual + #unmatchedStudio) * UNMATCHED_PENALTY