Compare commits
1 Commits
main
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de6501faa7 |
@@ -53,7 +53,7 @@ Progress
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 98.96% | 86.48% | 60.34% | 90.99% |
|
||||
| 98.99% | 86.48% | 60.34% | 90.99% |
|
||||
|
||||
units 902/1027 complete, functions 12145/12563 matched.
|
||||
|
||||
|
||||
@@ -709,7 +709,7 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
|
||||
firstPhoneticPass = 0;
|
||||
for (rangeIndex = 1; rangeIndex < match.nSeg; ++rangeIndex) {
|
||||
for (rangeCount = 4; rangeCount < 12; ++rangeCount) {
|
||||
if (match.segs1[rangeIndex * 12 + rangeCount]) goto engine_finish;
|
||||
if ((match.segs1 + rangeIndex * 12)[rangeCount]) goto engine_finish;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -730,8 +730,10 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
|
||||
alternateTable = (ziU8*)Zi8GetTableAddress(1, 5, work);
|
||||
alternateCount = Zi8GetTableCount(1, 5, work);
|
||||
}
|
||||
if ((request->context & 0x40) && Zi8GetFormatVersion(1, work) &&
|
||||
(singleCharacterCount = Zi8GetTableCount(1, 15, work))) recordCount = singleCharacterCount;
|
||||
if ((request->context & 0x40) && Zi8GetFormatVersion(1, work) >= 1) {
|
||||
singleCharacterCount = Zi8GetTableCount(1, 15, work);
|
||||
if (singleCharacterCount) recordCount = singleCharacterCount;
|
||||
}
|
||||
if ((request->context & 0x80) && request->scratch) {
|
||||
Zi8Memset(request->scratch, 0, (recordCount + 7) / 8);
|
||||
trackDuplicates = 1;
|
||||
@@ -751,12 +753,13 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
|
||||
if (!componentTable) {
|
||||
componentCount = Zi8GetTableCount(1, 7, work);
|
||||
componentOrdinals = (ziU8*)Zi8GetTableAddress(1, 7, work);
|
||||
componentTable = (ziU8*)Zi8GetTableAddress(1, 2, work);
|
||||
componentCursor = componentTable + 8;
|
||||
componentIndex = componentCount - 1;
|
||||
componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work);
|
||||
componentTable = componentCursor;
|
||||
componentCursor += 8;
|
||||
--componentCount;
|
||||
componentIndex = componentCount;
|
||||
alternateCharacter = 0;
|
||||
phoneticRetry = 1;
|
||||
componentCount = componentIndex;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -844,10 +847,10 @@ engine_search:
|
||||
match.arrD[2] == (record[2] & match.arr1[2]) &&
|
||||
match.arrD[1] == (record[1] & match.arr1[1]))) &&
|
||||
(ziU8)Zi8SecMatchChar(record, componentTable, &match, 0, work)) candidateStatus = 1;
|
||||
if (candidateStatus && match.nSeg > 1) {
|
||||
if (candidateStatus && getMode == 0 && match.nSeg > 1) {
|
||||
emittedWords = 0;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index) ++emittedWords;
|
||||
if (emittedWords < match.nSeg) candidateStatus = 0;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index, ++emittedWords) {}
|
||||
if (match.nSeg > emittedWords) candidateStatus = 0;
|
||||
else {
|
||||
for (index = 1; index < match.nSeg; ++index) {
|
||||
character = currentSpelling[request->wordCharCount + index];
|
||||
@@ -871,8 +874,8 @@ engine_search:
|
||||
match.phon[0], match.phon2[0], charset, work)) candidateStatus = 1;
|
||||
if (candidateStatus && match.nCand > 1) {
|
||||
emittedWords = 0;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index) ++emittedWords;
|
||||
if (emittedWords < match.nCand) candidateStatus = 0;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index, ++emittedWords) {}
|
||||
if (match.nCand > emittedWords) candidateStatus = 0;
|
||||
else {
|
||||
for (index = 1; index < match.nCand; ++index) {
|
||||
character = currentSpelling[request->wordCharCount + index];
|
||||
@@ -898,7 +901,7 @@ engine_search:
|
||||
} else if (Zi8IsDupWChar(candidateOrdinal, work)) continue;
|
||||
} else {
|
||||
emittedWords = 0;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index) ++emittedWords;
|
||||
for (index = request->wordCharCount; currentSpelling[index]; ++index, ++emittedWords) {}
|
||||
if (!request->elementCount) {
|
||||
if (prefixSearch) emittedWords = 1;
|
||||
} else if ((getMode == 1 || getMode == 2) && match.nCand) {
|
||||
@@ -965,18 +968,19 @@ pud_candidate:
|
||||
if (getMode == 2 && index >= request->elementCount + wordLength) {
|
||||
rangeIndex = 0;
|
||||
rangeCount = wordLength;
|
||||
while (rangeIndex < request->elementCount &&
|
||||
((currentSpelling[rangeCount] == 0x2C9 && elements[rangeIndex] == 0xF331) ||
|
||||
while (rangeIndex < request->elementCount) {
|
||||
if (!((currentSpelling[rangeCount] == 0x2C9 && elements[rangeIndex] == 0xF331) ||
|
||||
(currentSpelling[rangeCount] == 0x2CA && elements[rangeIndex] == 0xF332) ||
|
||||
(currentSpelling[rangeCount] == 0x2C7 && elements[rangeIndex] == 0xF333) ||
|
||||
(currentSpelling[rangeCount] == 0x2CB && elements[rangeIndex] == 0xF334) ||
|
||||
(currentSpelling[rangeCount] == 0x2D9 && elements[rangeIndex] == 0xF335) ||
|
||||
currentSpelling[rangeCount] == elements[rangeIndex] - 0xC200)) {
|
||||
currentSpelling[rangeCount] == elements[rangeIndex] - 0xC200)) break;
|
||||
++rangeCount;
|
||||
++rangeIndex;
|
||||
}
|
||||
if (rangeIndex == request->elementCount) {
|
||||
if (!(request->context & 0x10)) request->count = request->elementCount;
|
||||
candidateStatus = 1;
|
||||
character = currentSpelling[wordLength];
|
||||
candidateOrdinal = 0xFFFF;
|
||||
goto pud_accept;
|
||||
@@ -1060,7 +1064,7 @@ pud_accept:
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, candidateOrdinal, work);
|
||||
} else {
|
||||
emittedWords = 0;
|
||||
for (index = wordLength; currentSpelling[index]; ++index) ++emittedWords;
|
||||
for (index = wordLength; currentSpelling[index]; ++index, ++emittedWords) {}
|
||||
if (!request->elementCount) {
|
||||
if (prefixSearch) emittedWords = 1;
|
||||
} else if ((getMode == 1 || getMode == 2) && match.nCand) emittedWords = match.nCand;
|
||||
@@ -1281,8 +1285,7 @@ context_phrase_match:
|
||||
do {
|
||||
character = (ziU16)frequencyTable[1] << 8 | frequencyTable[0];
|
||||
frequencyTable += 2;
|
||||
output[outputIndex + emittedWords] = Zi8Ord2Uni(character & 0x7FFF, work);
|
||||
++emittedWords;
|
||||
output[outputIndex + emittedWords++] = Zi8Ord2Uni(character & 0x7FFF, work);
|
||||
} while (!(character & 0x8000));
|
||||
if (!request->elementCount) {
|
||||
if (prefixSearch) emittedWords = 1;
|
||||
@@ -1296,8 +1299,7 @@ context_phrase_match:
|
||||
if (getOptions == 5) {
|
||||
if (totalResults >= options->maxResults) goto engine_finish;
|
||||
} else {
|
||||
++((ZiChineseWork*)work)->duplicateIndex;
|
||||
if (((ZiChineseWork*)work)->duplicateIndex > 63) ((ZiChineseWork*)work)->duplicateIndex = 0;
|
||||
if (++((ZiChineseWork*)work)->duplicateIndex >= 64) ((ZiChineseWork*)work)->duplicateIndex = 0;
|
||||
if (!emitWords) output[emittedCount] = previousOrdinal;
|
||||
else {
|
||||
output[outputIndex + emittedWords] = ' ';
|
||||
@@ -1353,7 +1355,7 @@ dictionary_search:
|
||||
} else if (Zi8IsDupWordW(&character, 1, work)) goto prediction_next;
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!emitWords) output[emittedCount] = character;
|
||||
if (!emitWords) output[emittedCount++] = character;
|
||||
else {
|
||||
++emittedCount;
|
||||
output[outputIndex++] = character;
|
||||
@@ -1361,7 +1363,6 @@ dictionary_search:
|
||||
if (outputIndex > outputLimit) goto engine_finish;
|
||||
goto prediction_limit;
|
||||
}
|
||||
++emittedCount;
|
||||
prediction_limit:
|
||||
if (emittedCount >= request->maxCandidates) goto engine_finish;
|
||||
} else --skipCount;
|
||||
@@ -1397,7 +1398,7 @@ candidate_dictionary_search:
|
||||
candidateOrdinal = ((ziU16)ordinalTable[ordinalIndex * 2] << 8) + ordinalTable[ordinalIndex * 2 + 1];
|
||||
record = records + candidateOrdinal * 12;
|
||||
if (!(record[0] & charset)) continue;
|
||||
phraseEntry = phraseTable + ((record[9] & 15) << 16 | record[11] | record[10] << 8);
|
||||
phraseEntry = phraseTable + ((record[9] & 15) << 16 | (record[11] | record[10] << 8));
|
||||
candidateStatus = 0;
|
||||
if (getMode == 8 || getMode == 9) {
|
||||
index = phraseEntry[0] & 7;
|
||||
@@ -1433,9 +1434,8 @@ candidate_dictionary_search:
|
||||
++totalResults;
|
||||
if (!emitWords) output[emittedCount] = character;
|
||||
else {
|
||||
output[outputIndex] = character;
|
||||
output[outputIndex + 1] = ' ';
|
||||
outputIndex += 2;
|
||||
output[outputIndex++] = character;
|
||||
output[outputIndex++] = ' ';
|
||||
if (outputIndex > outputLimit) { ++emittedCount; goto engine_finish; }
|
||||
}
|
||||
++emittedCount;
|
||||
@@ -1483,7 +1483,7 @@ character_range_start:
|
||||
}
|
||||
firstOrdinal = (ziU16)phoneticGroups[rangeIndex + 1] << 8 | phoneticGroups[rangeIndex];
|
||||
record += firstOrdinal * 12;
|
||||
candidateCount = ((ziU16)phoneticGroups[rangeCount + 1] << 8 | phoneticGroups[rangeCount]) - firstOrdinal;
|
||||
candidateCount = (phoneticGroups[rangeCount] | (ziU16)phoneticGroups[rangeCount + 1] << 8) - firstOrdinal;
|
||||
}
|
||||
remainingOrdinals = candidateCount;
|
||||
while (1) {
|
||||
@@ -1507,11 +1507,12 @@ character_range_start:
|
||||
}
|
||||
if (candidateOrdinal == previousOrdinal) goto character_range_next;
|
||||
if (!emitWords) {
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(ordinalIndex, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, ordinalIndex, work);
|
||||
} else candidateStatus = Zi8IsDupWordW(&candidateOrdinal, 1, work);
|
||||
if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, ordinalIndex, work)) goto character_range_next;
|
||||
} else if (Zi8IsDupWChar(ordinalIndex, work)) goto character_range_next;
|
||||
} else if (Zi8IsDupWordW(&candidateOrdinal, 1, work)) goto character_range_next;
|
||||
previousOrdinal = candidateOrdinal;
|
||||
if (candidateStatus) goto character_range_next;
|
||||
|
||||
if (skipCount) {
|
||||
--skipCount;
|
||||
if (seenCount < 5) seenOrdinals[seenCount++] = previousOrdinal;
|
||||
@@ -1522,9 +1523,8 @@ character_range_start:
|
||||
if (duplicateIndex < emittedCount) goto character_range_next;
|
||||
output[emittedCount] = previousOrdinal;
|
||||
} else {
|
||||
output[outputIndex] = previousOrdinal;
|
||||
output[outputIndex + 1] = ' ';
|
||||
outputIndex += 2;
|
||||
output[outputIndex++] = previousOrdinal;
|
||||
output[outputIndex++] = ' ';
|
||||
if (outputIndex > outputLimit) { ++emittedCount; goto engine_finish; }
|
||||
}
|
||||
++emittedCount;
|
||||
@@ -1548,24 +1548,27 @@ character_range_done:
|
||||
if (!Zi8PriMatchNextChar(record, match.arr1[0], match.arrD[0], match.arr1[1], match.arrD[1],
|
||||
match.arr1[2], match.arrD[2], match.arr1[3], match.arrD[3],
|
||||
&candidateCount, &record, &candidateOrdinal, work) ||
|
||||
!(ziU8)Zi8SecMatchChar(record, componentTable, &match, &candidateOrdinal, work)) goto ordinal_next;
|
||||
!(ziU8)Zi8SecMatchChar(record, componentTable, &match, &candidateOrdinal, work)) { ++tableIndex; continue; }
|
||||
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = phraseOrdinal;
|
||||
((ZiChineseWork*)work)->duplicateCharacters[((ZiChineseWork*)work)->duplicateIndex] = candidateOrdinal;
|
||||
if (charsetTable) {
|
||||
charsetEntry = charsetTable + phraseOrdinal;
|
||||
if (!(charsetEntry[0] & charsetFilter)) goto ordinal_next;
|
||||
if (!(charsetEntry[0] & charsetFilter)) { ++tableIndex; continue; }
|
||||
}
|
||||
if (!emitWords) {
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(phraseOrdinal, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, phraseOrdinal, work);
|
||||
} else candidateStatus = Zi8IsDupWordW(&candidateOrdinal, 1, work);
|
||||
if (candidateStatus) goto ordinal_next;
|
||||
if (emitWords) {
|
||||
if (Zi8IsDupWordW(&candidateOrdinal, 1, work)) { ++tableIndex; continue; }
|
||||
} else if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, phraseOrdinal, work)) { ++tableIndex; continue; }
|
||||
} else if (Zi8IsDupWChar(phraseOrdinal, work)) { ++tableIndex; continue; }
|
||||
|
||||
recordFrequency = (record[4] & 0xFC) >> 2;
|
||||
exactPhrase = 0;
|
||||
}
|
||||
if (seenCount) {
|
||||
for (duplicateIndex = 0; duplicateIndex < seenCount && candidateOrdinal != seenOrdinals[duplicateIndex]; ++duplicateIndex) {}
|
||||
if (duplicateIndex < seenCount) goto ordinal_done;
|
||||
for (duplicateIndex = 0; duplicateIndex < seenCount; ++duplicateIndex) {
|
||||
if (candidateOrdinal == seenOrdinals[duplicateIndex]) break;
|
||||
}
|
||||
if (duplicateIndex < seenCount) { exactPhrase = 1; ++tableIndex; continue; }
|
||||
}
|
||||
if (candidateOrdinal != previousOrdinal) {
|
||||
previousOrdinal = candidateOrdinal;
|
||||
@@ -1590,7 +1593,6 @@ ordinal_limit:
|
||||
}
|
||||
ordinal_done:
|
||||
exactPhrase = 1;
|
||||
ordinal_next:
|
||||
++tableIndex;
|
||||
}
|
||||
exactPhrase = 1;
|
||||
@@ -1629,10 +1631,11 @@ phonetic_ordinal_search:
|
||||
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = phraseOrdinal;
|
||||
((ZiChineseWork*)work)->duplicateCharacters[((ZiChineseWork*)work)->duplicateIndex] = candidateOrdinal;
|
||||
if (!emitWords) {
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(phraseOrdinal, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, phraseOrdinal, work);
|
||||
} else candidateStatus = Zi8IsDupWordW(&candidateOrdinal, 1, work);
|
||||
if (candidateStatus) continue;
|
||||
if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, phraseOrdinal, work)) continue;
|
||||
} else if (Zi8IsDupWChar(phraseOrdinal, work)) continue;
|
||||
} else if (Zi8IsDupWordW(&candidateOrdinal, 1, work)) continue;
|
||||
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!options->countOnly) {
|
||||
@@ -1876,10 +1879,11 @@ global_character_loop:
|
||||
match.arr1D[3] == (match.arr19[3] & phraseEntry[3]) &&
|
||||
((resultFallback && (phraseEntry[0] & 7) == match.length) || (!resultFallback && (phraseEntry[0] & 7) > match.length)))) goto global_character_next;
|
||||
if (!emitWords) {
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(ordinalIndex, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, ordinalIndex, work);
|
||||
} else candidateStatus = Zi8IsDupWordW(&character, 1, work);
|
||||
if (candidateStatus) goto global_character_next;
|
||||
if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, ordinalIndex, work)) goto global_character_next;
|
||||
} else if (Zi8IsDupWChar(ordinalIndex, work)) goto global_character_next;
|
||||
} else if (Zi8IsDupWordW(&character, 1, work)) goto global_character_next;
|
||||
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!options->countOnly) {
|
||||
@@ -1941,7 +1945,7 @@ cangjie_components:
|
||||
break;
|
||||
case 2: rangeIndex = 4; rangeCount = 6; phase = 0xFF; break;
|
||||
}
|
||||
firstOrdinal = (ziU16)phoneticGroups[rangeIndex + 1] << 8 | phoneticGroups[rangeIndex];
|
||||
firstOrdinal = phoneticGroups[rangeIndex] | (ziU16)phoneticGroups[rangeIndex + 1] << 8;
|
||||
record += firstOrdinal * 12;
|
||||
candidateCount = ((ziU16)phoneticGroups[rangeCount + 1] << 8 | phoneticGroups[rangeCount]) - firstOrdinal;
|
||||
}
|
||||
@@ -1966,10 +1970,8 @@ component_retry:
|
||||
}
|
||||
if (!(ziU8)Zi8SecMatchChar(record, componentTable, &match, &candidateOrdinal, work)) goto component_record_next;
|
||||
ordinalIndex = remainingOrdinals - candidateCount + firstOrdinal - 1;
|
||||
if (charsetTable) {
|
||||
charsetEntry = charsetTable + ordinalIndex;
|
||||
if (!(charsetEntry[0] & charsetFilter)) goto component_record_next;
|
||||
}
|
||||
if (charsetTable) charsetEntry = charsetTable + ordinalIndex;
|
||||
if (charsetTable && !(charsetEntry[0] & charsetFilter)) goto component_record_next;
|
||||
((ZiChineseWork*)work)->duplicateCharacters[((ZiChineseWork*)work)->duplicateIndex] = candidateOrdinal;
|
||||
currentSpelling[0] = candidateOrdinal;
|
||||
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = ordinalIndex;
|
||||
@@ -2088,20 +2090,17 @@ frequency_range_retry:
|
||||
}
|
||||
}
|
||||
ordinalIndex = remainingOrdinals - candidateCount + firstOrdinal - 1;
|
||||
if (charsetTable) {
|
||||
charsetEntry = charsetTable + ordinalIndex;
|
||||
if (!(charsetEntry[0] & charsetFilter)) { record += 12; continue; }
|
||||
}
|
||||
if (charsetTable) charsetEntry = charsetTable + ordinalIndex;
|
||||
if (charsetTable && !(charsetEntry[0] & charsetFilter)) { record += 12; continue; }
|
||||
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = ordinalIndex;
|
||||
((ZiChineseWork*)work)->duplicateCharacters[((ZiChineseWork*)work)->duplicateIndex] = candidateOrdinal;
|
||||
if (!emitWords) {
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(ordinalIndex, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, ordinalIndex, work);
|
||||
} else candidateStatus = Zi8IsDupWordW(&candidateOrdinal, 1, work);
|
||||
if (!candidateStatus) {
|
||||
exactPhrase = 0;
|
||||
recordFrequency = (record[4] & 0xFC) >> 2;
|
||||
}
|
||||
if (emitWords) {
|
||||
if (Zi8IsDupWordW(&candidateOrdinal, 1, work)) { record += 12; continue; }
|
||||
} else if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, ordinalIndex, work)) { record += 12; continue; }
|
||||
} else if (Zi8IsDupWChar(ordinalIndex, work)) { record += 12; continue; }
|
||||
exactPhrase = 0;
|
||||
recordFrequency = (record[4] & 0xFC) >> 2;
|
||||
record += 12;
|
||||
}
|
||||
}
|
||||
@@ -2156,7 +2155,7 @@ frequency_character_next:
|
||||
} else {
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!emitWords) output[emittedCount] = alternateCharacter;
|
||||
if (!emitWords) output[emittedCount++] = alternateCharacter;
|
||||
else {
|
||||
++emittedCount;
|
||||
output[outputIndex++] = alternateCharacter;
|
||||
@@ -2164,7 +2163,6 @@ frequency_character_next:
|
||||
if (outputIndex > outputLimit) goto engine_finish;
|
||||
goto frequency_component_limit;
|
||||
}
|
||||
++emittedCount;
|
||||
frequency_component_limit:
|
||||
if (emittedCount >= request->maxCandidates) goto engine_finish;
|
||||
} else --skipCount;
|
||||
@@ -2215,21 +2213,21 @@ phonetic_main:
|
||||
if (!duplicateIndex) isFirstCandidate = 1;
|
||||
else isFirstCandidate = 0;
|
||||
if ((match.phon2[0] & 7) || (match.phon2[1] & 7)) isFirstCandidate = 1;
|
||||
if ((match.phon2[0] & 0x7E00) == 0x200) {
|
||||
firstValue = (match.phon2[0] >> 3) & 0x3F;
|
||||
firstMask = (match.phon[0] >> 3) & 0x3F | 0x80;
|
||||
} else {
|
||||
if ((match.phon2[0] & 0x7E00) != 0x200) {
|
||||
firstValue = (match.phon2[0] >> 9) & 0x3F | 0x80;
|
||||
firstMask = (match.phon[0] >> 9) & 0x3F | 0x80;
|
||||
if (match.phon[0] & 0x1F8) isFirstCandidate = 1;
|
||||
}
|
||||
if ((match.phon2[1] & 0x7E00) == 0x200) {
|
||||
secondValue = (match.phon2[1] >> 3) & 0x3F;
|
||||
secondMask = (match.phon[1] >> 3) & 0x3F | 0x80;
|
||||
} else {
|
||||
firstValue = (match.phon2[0] >> 3) & 0x3F;
|
||||
firstMask = (match.phon[0] >> 3) & 0x3F | 0x80;
|
||||
}
|
||||
if ((match.phon2[1] & 0x7E00) != 0x200) {
|
||||
secondValue = (match.phon2[1] >> 9) & 0x3F | 0x80;
|
||||
secondMask = (match.phon[1] >> 9) & 0x3F | 0x80;
|
||||
if (match.phon[1] & 0x1F8) isFirstCandidate = 1;
|
||||
} else {
|
||||
secondValue = (match.phon2[1] >> 3) & 0x3F;
|
||||
secondMask = (match.phon[1] >> 3) & 0x3F | 0x80;
|
||||
}
|
||||
rangeIndex = 0;
|
||||
for (ordinalIndex = 0; ordinalIndex <= duplicateIndex; ++ordinalIndex) {
|
||||
@@ -2323,12 +2321,12 @@ phonetic_ordinals:
|
||||
record = records;
|
||||
candidateCount = recordCount;
|
||||
phoneticGroups = 0;
|
||||
while (emittedCount < request->maxCandidates && candidateCount &&
|
||||
Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
|
||||
while (emittedCount < request->maxCandidates && candidateCount) {
|
||||
if (!Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
|
||||
phraseTable, (ZiChineseRecord*)record, match.phon, match.phon2,
|
||||
&candidateCount, (ZiChineseRecord**)&record, (int*)&phoneticGroups,
|
||||
emitWords, singleCharacterPass, match.nCand, phoneticMask, phoneticMatch, charset,
|
||||
requireFull, recordCount, &candidateOrdinal, filteringMode, work)) {
|
||||
requireFull, recordCount, &candidateOrdinal, filteringMode, work)) break;
|
||||
ordinalIndex = recordCount - candidateCount - 1;
|
||||
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = ordinalIndex;
|
||||
((ZiChineseWork*)work)->duplicateCharacters[((ZiChineseWork*)work)->duplicateIndex] = candidateOrdinal;
|
||||
@@ -2353,8 +2351,9 @@ phonetic_ordinals:
|
||||
if (!emitWords) {
|
||||
if (candidateOrdinal == previousOrdinal) goto phonetic_record_next;
|
||||
previousOrdinal = candidateOrdinal;
|
||||
if (!trackDuplicates) candidateStatus = Zi8IsDupWChar(ordinalIndex, work);
|
||||
else candidateStatus = Zi8SetFindCand(request->scratch, ordinalIndex, work);
|
||||
if (trackDuplicates) {
|
||||
if ((ziU8)Zi8SetFindCand(request->scratch, ordinalIndex, work)) goto phonetic_record_next;
|
||||
} else if (Zi8IsDupWChar(ordinalIndex, work)) goto phonetic_record_next;
|
||||
} else {
|
||||
output[outputIndex] = candidateOrdinal;
|
||||
emittedWords = 1;
|
||||
@@ -2369,26 +2368,24 @@ phonetic_ordinals:
|
||||
if (!request->elementCount) emittedWords = 1;
|
||||
else emittedWords = match.nCand;
|
||||
}
|
||||
candidateStatus = Zi8IsDupWordW(output + outputIndex, emittedWords, work);
|
||||
}
|
||||
if (!candidateStatus) {
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!options->countOnly) {
|
||||
++((ZiChineseWork*)work)->duplicateIndex;
|
||||
if (((ZiChineseWork*)work)->duplicateIndex > 63) ((ZiChineseWork*)work)->duplicateIndex = 0;
|
||||
if (!emitWords) {
|
||||
output[emittedCount] = candidateOrdinal;
|
||||
++emittedCount;
|
||||
} else {
|
||||
++emittedCount;
|
||||
output[outputIndex + emittedWords] = ' ';
|
||||
outputIndex += emittedWords + 1;
|
||||
if (emittedCount >= request->maxCandidates || outputIndex > outputLimit) goto engine_finish;
|
||||
}
|
||||
} else if (totalResults >= options->maxResults) goto engine_finish;
|
||||
} else --skipCount;
|
||||
if (Zi8IsDupWordW(output + outputIndex, emittedWords, work)) goto phonetic_record_next;
|
||||
}
|
||||
if (!skipCount) {
|
||||
++totalResults;
|
||||
if (!options->countOnly) {
|
||||
++((ZiChineseWork*)work)->duplicateIndex;
|
||||
if (((ZiChineseWork*)work)->duplicateIndex > 63) ((ZiChineseWork*)work)->duplicateIndex = 0;
|
||||
if (!emitWords) {
|
||||
output[emittedCount] = candidateOrdinal;
|
||||
++emittedCount;
|
||||
} else {
|
||||
++emittedCount;
|
||||
output[outputIndex + emittedWords] = ' ';
|
||||
outputIndex += emittedWords + 1;
|
||||
if (emittedCount >= request->maxCandidates || outputIndex > outputLimit) goto engine_finish;
|
||||
}
|
||||
} else if (totalResults >= options->maxResults) goto engine_finish;
|
||||
} else --skipCount;
|
||||
phonetic_record_next:
|
||||
record += 12;
|
||||
}
|
||||
@@ -2434,12 +2431,16 @@ engine_finish:
|
||||
getMode = 7;
|
||||
goto candidate_dictionary_search;
|
||||
}
|
||||
if (emitWords && outputIndex) output[outputIndex++] = 0;
|
||||
if (emitWords && outputIndex) {
|
||||
output[outputIndex] = 0;
|
||||
++outputIndex;
|
||||
}
|
||||
request->letters = emittedCount;
|
||||
if (!totalResults && !request->firstCandidate && getMode == 1 && match.nCand >= 2 &&
|
||||
(match.phon2[match.nCand - 1] & 0xFFF8) == 0x7600) {
|
||||
match.phon[match.nCand - 1] = (match.phon[match.nCand - 1] & 7) + 0x7FF8;
|
||||
match.phon2[match.nCand - 1] = (match.phon2[match.nCand - 1] & 7) + 0x398;
|
||||
singleCharacterPass = 1;
|
||||
goto engine_search;
|
||||
}
|
||||
if (savedPudCount) ((struct __zi8_work_data_s*)work)->pudCount = savedPudCount;
|
||||
@@ -2450,8 +2451,7 @@ filtered_search:
|
||||
frequencyTable = Zi8GetTableAddress(1, 31, work);
|
||||
for (; userIndex; --userIndex) {
|
||||
index = frequencyTable[0] & 15;
|
||||
groupHeader = *frequencyTable++;
|
||||
if (!(groupHeader & charset)) goto filtered_next;
|
||||
if (!(*frequencyTable++ & charset)) goto filtered_next;
|
||||
rangeIndex = 0;
|
||||
if (filteringMode == 4) {
|
||||
rangeIndex = request->wordCharCount;
|
||||
@@ -2488,8 +2488,8 @@ filtered_search:
|
||||
match.arrD[1] != (record[1] & match.arr1[1]))) ||
|
||||
!(ziU8)Zi8SecMatchChar(record, componentTable, &match, 0, work)) goto filtered_next;
|
||||
for (rangeCount = 1; rangeCount < match.nSeg; ++rangeCount) {
|
||||
record = records + (ziU16)frequencyTable[(rangeIndex + rangeCount) * 2] * 12 +
|
||||
((ziU16)frequencyTable[(rangeIndex + rangeCount) * 2 + 1] << 8) * 12;
|
||||
record = records + (frequencyTable[(rangeIndex + rangeCount) * 2] +
|
||||
((ziU16)frequencyTable[(rangeIndex + rangeCount) * 2 + 1] << 8)) * 12;
|
||||
if (match.segsD[rangeCount * 12] != (record[0] & match.segs1[rangeCount * 12]) ||
|
||||
match.segsD[rangeCount * 12 + 1] != (record[1] & match.segs1[rangeCount * 12 + 1]) ||
|
||||
match.segsD[rangeCount * 12 + 2] != (record[2] & match.segs1[rangeCount * 12 + 2]) ||
|
||||
@@ -2565,13 +2565,12 @@ filtered_accept:
|
||||
++((ZiChineseWork*)work)->duplicateIndex;
|
||||
if (((ZiChineseWork*)work)->duplicateIndex > 63) ((ZiChineseWork*)work)->duplicateIndex = 0;
|
||||
if (filteringMode == 4) request->unk_0x20 = emittedCount + 1;
|
||||
if (!emitWords) output[emittedCount] = candidateOrdinal;
|
||||
else {
|
||||
output[outputIndex + rangeCount] = ' ';
|
||||
outputIndex += rangeCount + 1;
|
||||
if (outputIndex > outputLimit) { ++emittedCount; goto engine_finish; }
|
||||
}
|
||||
++emittedCount;
|
||||
if (emitWords) {
|
||||
++emittedCount;
|
||||
outputIndex += rangeCount;
|
||||
output[outputIndex++] = ' ';
|
||||
if (outputIndex > outputLimit) goto engine_finish;
|
||||
} else output[emittedCount++] = candidateOrdinal;
|
||||
if (emittedCount >= request->maxCandidates) goto engine_finish;
|
||||
}
|
||||
} else --skipCount;
|
||||
|
||||
@@ -245,3 +245,155 @@ forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
## Continued region and branch matching, 2026-10-01
|
||||
|
||||
Fresh branch from origin/main 3c235852. User authorizes keeping either smaller absolute instruction deficit or higher engine fuzzy score, subject to the unchanged pool/data/regression/source gates. Baseline deficit 62, fuzzy 78.76161%, exact functions 5/8, code 4168/47816, data 72/536.
|
||||
- c01-phonetic-loop-call: R14: separate phonetic-match failure from candidate loop bounds. Deficit 62 -> 61; engine fuzzy 78.76161% -> 79.36390%; kept.
|
||||
- c02-finish-terminator: R15: store word output terminator before advancing cursor. Deficit 61 -> 61; engine fuzzy 79.36390% -> 79.36943%; kept.
|
||||
- c03-pud-switch: R4: order PUD component phonetic and fixed matching with mode switch. Deficit 61 -> 59; engine fuzzy 79.36943% -> 80.17310%; rejected and restored.
|
||||
- c04-context-count: R1: split context format and table-count setup. Deficit 61 -> 61; engine fuzzy 79.36943% -> 79.37964%; kept.
|
||||
- c05-finish-capacity: R15: use a selected retry capacity for count-only and emitted output. Deficit 61 -> 48; engine fuzzy 79.37964% -> 79.17226%; kept.
|
||||
- c06-filtered-record: R16: decode filtered ordinal before applying record stride. Deficit 48 -> 50; engine fuzzy 79.17226% -> 79.17788%; kept.
|
||||
- c07-pud-tone-status: R4: retain successful tone-spelling match status before accepting PUD. Deficit 50 -> 51; engine fuzzy 79.17788% -> 79.11175%; rejected and restored.
|
||||
- c08-pud-switch-status: R4: switch PUD match cases with successful tone status. Deficit 50 -> 45; engine fuzzy 79.17788% -> 80.01780%; rejected and restored.
|
||||
- c09-retry-single-pass: R15: restore single-character phase before phonetic fallback retry. Deficit 50 -> 49; engine fuzzy 79.17788% -> 78.92460%; kept.
|
||||
- c10-retry-setup-placement: R3/R15: place single-character reset at fallback and keep initial full-match option. Deficit 49 -> 52; engine fuzzy 78.92460% -> 78.90914%; rejected and restored.
|
||||
- c12-engine-option-lifetime: R3: use established full-match option and reset single-character phase only at retry. Deficit 49 -> 55; engine fuzzy 78.92460% -> 79.14088%; rejected and restored.
|
||||
- c13-filtered-header: R16: test the advancing filtered group header directly. Deficit 49 -> 50; engine fuzzy 78.92460% -> 78.97555%; kept.
|
||||
- c14-pud-tone-loop: R4: split tone comparison failure from range scan bounds. Deficit 50 -> 50; engine fuzzy 78.97555% -> 79.21431%; kept.
|
||||
- c15-pud-switch-loop: R4: dispatch PUD matching cases after separating tone scan exit. Deficit 50 -> 45; engine fuzzy 79.21431% -> 80.15755%; rejected and restored.
|
||||
- c16-pud-duplicates: R4: check character and word duplicate results in their own branches. Deficit 50 -> 44; engine fuzzy 79.21431% -> 79.11671%; rejected and restored.
|
||||
- c17-pud-output-paths: R4: count words before copying and postincrement PUD output cursors. Deficit 50 -> 47; engine fuzzy 79.21431% -> 79.07943%; rejected and restored.
|
||||
- c18-pud-switch-outputs: R4: dispatch PUD mode cases with target output count placement. Deficit 50 -> 45; engine fuzzy 79.21431% -> 80.15755%; rejected and restored.
|
||||
- c19-pud-complete-branches: R4: restore PUD switch duplicate exits and output cursor paths together. Deficit 50 -> 46; engine fuzzy 79.21431% -> 80.37851%; rejected and restored.
|
||||
- c20-finish-capacity-failure: R15: test retry exhaustion with count-only and emitted capacities. Deficit 50 -> 55; engine fuzzy 79.21431% -> 79.47246%; rejected and restored.
|
||||
- c21-prediction-postcount: R6: postincrement character output count in prediction path. Deficit 50 -> 48; engine fuzzy 79.21431% -> 79.10697%; kept.
|
||||
- c22-ordinal-postcount: R8: postincrement ordinal character output count. Deficit 48 -> 49; engine fuzzy 79.10697% -> 78.96722%; rejected and restored.
|
||||
- c23-phonetic-ordinal-postcount: R8: postincrement phonetic ordinal character output count. Deficit 48 -> 48; engine fuzzy 79.10697% -> 78.95832%; rejected and restored.
|
||||
- c24-tone-postcount: R9: postincrement tone output count. Deficit 48 -> 48; engine fuzzy 79.10697% -> 78.92460%; rejected and restored.
|
||||
- c25-alternate-tone-postcount: R9: postincrement alternate tone output count. Deficit 48 -> 46; engine fuzzy 79.10697% -> 78.93977%; rejected and restored.
|
||||
- c26-user-postcount: R9: postincrement user character output count. Deficit 48 -> 50; engine fuzzy 79.10697% -> 78.86877%; rejected and restored.
|
||||
- c27-frequency-postcount: R12: postincrement frequency character output count. Deficit 48 -> 49; engine fuzzy 79.10697% -> 78.84910%; rejected and restored.
|
||||
- c28-context-word-count: R5: increment appended context word length within character store. Deficit 48 -> 47; engine fuzzy 79.10697% -> 79.14368%; kept.
|
||||
- c29-frequency-component-count: R12: postincrement frequency component output count. Deficit 47 -> 45; engine fuzzy 79.14368% -> 79.13432%; kept.
|
||||
- c30-dictionary-duplicates: R6: branch directly on dictionary duplicate check results. Deficit 45 -> 50; engine fuzzy 79.13432% -> 79.08589%; rejected and restored.
|
||||
- c31-range-duplicates: R7: branch directly on range duplicate check results. Deficit 45 -> 45; engine fuzzy 79.13432% -> 79.21637%; kept.
|
||||
- c32-oem-component-mode: R3: retain component mode check before OEM segment validation. Deficit 45 -> 40; engine fuzzy 79.21637% -> 79.20972%; kept.
|
||||
- c33-oem-phonetic-mode: R3: retain phonetic mode check before OEM multi-syllable validation. Deficit 40 -> 37; engine fuzzy 79.20972% -> 79.01274%; rejected and restored.
|
||||
- c34-oem-word-count-order: R3: advance OEM spelling cursor before increasing word length. Deficit 40 -> 37; engine fuzzy 79.20972% -> 79.18724%; kept.
|
||||
- c35-pud-word-count-order: R4: advance PUD spelling cursor before increasing word length. Deficit 37 -> 36; engine fuzzy 79.18724% -> 79.25000%; kept.
|
||||
- c36-oem-segment-length-order: R3: compare required segment length before emitted spelling length. Deficit 36 -> 36; engine fuzzy 79.25000% -> 79.25047%; kept.
|
||||
- c37-oem-phonetic-length-order: R3: compare required phonetic length before emitted spelling length. Deficit 36 -> 36; engine fuzzy 79.25047% -> 79.25094%; kept.
|
||||
- c38-component-table-setup: R1: retain table origin while advancing component cursor and decrementing count. Deficit 36 -> 35; engine fuzzy 79.25094% -> 79.41308%; kept.
|
||||
- c39-pud-dispatch-after-oem: R4: switch PUD dispatch after restoring OEM mode and scan order. Deficit 35 -> 41; engine fuzzy 79.41308% -> 80.42741%; rejected and restored.
|
||||
- c40-component-row-address: R0: address component segment row before its byte index. Deficit 35 -> 35; engine fuzzy 79.41308% -> 79.44998%; kept.
|
||||
- c41-dictionary-postindex: R6: advance each dictionary word output cursor within the store. Deficit 35 -> 39; engine fuzzy 79.44998% -> 79.51237%; kept.
|
||||
- c42-range-postindex: R7: advance each range word output cursor within its store. Deficit 39 -> 37; engine fuzzy 79.51237% -> 79.49841%; kept.
|
||||
- c43-pud-postindex-only: R4: postincrement PUD word copy cursor at each character. Deficit 37 -> 37; engine fuzzy 79.49841% -> 79.38170%; rejected and restored.
|
||||
- c44-component-range-bytes: R7: decode low ordinal byte before high byte in component ranges. Deficit 37 -> 37; engine fuzzy 79.49841% -> 79.48651%; rejected and restored.
|
||||
- c45-component-phase-bytes: R11: decode low ordinal byte before high byte in component phase. Deficit 37 -> 37; engine fuzzy 79.49841% -> 79.51808%; kept.
|
||||
- c46-finish-branch-capacity: R15: branch on count-only and emitted capacities without a Boolean temporary. Deficit 37 -> 49; engine fuzzy 79.51808% -> 79.74897%; kept.
|
||||
- c47-component-charset-block: R11: retain separate charset cursor setup and filtering branches. Deficit 49 -> 44; engine fuzzy 79.74897% -> 79.85378%; kept.
|
||||
- c48-frequency-charset-block: R12: retain separate frequency charset setup and filtering branches. Deficit 44 -> 45; engine fuzzy 79.85378% -> 79.86484%; kept.
|
||||
- c49-ordinal-direct-duplicates: R8: test ordinal character and word duplicate results at calls. Deficit 45 -> 39; engine fuzzy 79.86484% -> 79.77819%; kept.
|
||||
- c50-phonetic-ordinal-direct-duplicates: R8: test phonetic ordinal duplicate results at calls. Deficit 39 -> 39; engine fuzzy 79.77819% -> 79.83561%; kept.
|
||||
- c51-ordinal-loop-continuations: R8: express ordinal scan as for loop with direct continuations. Deficit 39 -> 39; engine fuzzy 79.83561% -> 79.83561%; rejected and restored.
|
||||
- c53-ordinal-rejection-cleanup: R8: advance ordinal cursor separately on rejected candidates. Deficit 39 -> 17; engine fuzzy 79.83561% -> 80.00159%; rejected and restored.
|
||||
- c55-ordinal-cleanup-word-first: R8: restore ordinal rejection increments with word-first duplicate paths. Deficit 39 -> 17; engine fuzzy 79.83561% -> 79.99812%; rejected and restored.
|
||||
- c56-ordinal-word-first-only: R8: place word duplicate branch before bitmap and character branches. Deficit 39 -> 40; engine fuzzy 79.83561% -> 79.96394; frame 0x4f0; data 72; kept.
|
||||
- c57-ordinal-seen-loop: R8: separate seen ordinal equality from scan bound. Deficit 40 -> 40; engine fuzzy 79.96394% -> 80.03410; frame 0x4f0; data 72; kept.
|
||||
- c58-ordinal-primary-rejection: R8: advance ordinal cursor on failed primary or secondary match. Deficit 40 -> 37; engine fuzzy 80.03410% -> 79.99110; frame 0x4e0; data 24; rejected and restored.
|
||||
- c59-ordinal-charset-rejection: R8: advance ordinal cursor on rejected charset. Deficit 40 -> 37; engine fuzzy 80.03410% -> 79.99157; frame 0x4e0; data 24; rejected and restored.
|
||||
- c60-ordinal-bitmap-rejection: R8: advance ordinal cursor on bitmap duplicate. Deficit 40 -> 37; engine fuzzy 80.03410% -> 80.03831; frame 0x4e0; data 24; rejected and restored.
|
||||
- c61-ordinal-character-rejection: R8: advance ordinal cursor on character duplicate. Deficit 40 -> 36; engine fuzzy 80.03410% -> 80.03503; frame 0x4e0; data 24; rejected and restored.
|
||||
- c62-ordinal-word-rejection: R8: advance ordinal cursor on word duplicate. Deficit 40 -> 37; engine fuzzy 80.03410% -> 80.03831; frame 0x4e0; data 24; rejected and restored.
|
||||
- c63-ordinal-seen-rejection: R8: reset exact phrase and advance cursor on seen ordinal. Deficit 40 -> 34; engine fuzzy 80.03410% -> 79.99953; frame 0x4e0; data 24; rejected and restored.
|
||||
- c64-frequency-duplicate-cleanup: R12: retain word-first duplicate checks and per-rejection record advancement. Deficit 40 -> 25; engine fuzzy 80.03410% -> 79.96965; frame 0x4e0; data 24; rejected and restored.
|
||||
- c65-filtered-output-paths: R16: count filtered words before copying and postincrement output cursors. Deficit 40 -> 40; engine fuzzy 80.03410% -> 80.25890; frame 0x4f0; data 72; kept.
|
||||
- c66-ordinal-cleanup-filtered: R8: restore ordinal rejection advancement after filtered emission repair. Deficit 40 -> 17; engine fuzzy 80.25890% -> 80.58009; frame 0x4e0; data 24; rejected and restored.
|
||||
- c67-ordinal-oem-scan-lifetimes: R8/R3: restore ordinal rejection increments with OEM spelling scan form. Deficit 40 -> 20; engine fuzzy 80.25890% -> 80.29627; frame 0x4e0; data 24; rejected and restored.
|
||||
- c68-ordinal-compare-order: R8: rejection cursor paths plus reverse repeated ordinal comparison. Deficit 40 -> 17; engine fuzzy 80.25890% -> 80.58009; frame 0x4e0; data 24; rejected and restored.
|
||||
- c69-ordinal-postcount-cleanup: R8: rejection cursor paths plus postincrement ordinal output count. Deficit 40 -> 18; engine fuzzy 80.25890% -> 80.36015; frame 0x4e0; data 24; rejected and restored.
|
||||
- c70-ordinal-seen-cleanup: R8: rejection cursor paths plus advance cursor on seen ordinal. Deficit 40 -> 11; engine fuzzy 80.25890% -> 80.65240; frame 0x4e0; data 24; rejected and restored.
|
||||
- c71-ordinal-byte-order: R8: rejection cursor paths plus decode low ordinal byte first. Deficit 40 -> 17; engine fuzzy 80.25890% -> 80.32793; frame 0x4e0; data 24; rejected and restored.
|
||||
- c72-ordinal-record-order: R8: rejection cursor paths plus address ordinal record after stride. Deficit 40 -> 17; engine fuzzy 80.25890% -> 80.58009; frame 0x4e0; data 24; rejected and restored.
|
||||
- c73-ordinal-frequency-order: R8: rejection cursor paths plus mark matched phase before extracting frequency. Deficit 40 -> 17; engine fuzzy 80.25890% -> 80.36661; frame 0x4e0; data 24; rejected and restored.
|
||||
- c74-cleanup-oem-output: R8 plus oem-output: restore rejection cursor paths and target source expression. Deficit 40 -> 13; engine fuzzy 80.25890% -> 80.59769; frame 0x4e0; data 24; rejected and restored.
|
||||
- c75-cleanup-pud-output: R8 plus pud-output: restore rejection cursor paths and target source expression. Deficit 40 -> 18; engine fuzzy 80.25890% -> 80.58102; frame 0x4e0; data 24; rejected and restored.
|
||||
- c76-cleanup-pud-duplicates: R8 plus pud-duplicates: restore rejection cursor paths and target source expression. Deficit 40 -> 15; engine fuzzy 80.25890% -> 80.51358; frame 0x4e0; data 24; rejected and restored.
|
||||
- c77-cleanup-pud-tone: R8 plus pud-tone: restore rejection cursor paths and target source expression. Deficit 40 -> 12; engine fuzzy 80.25890% -> 80.59161; frame 0x4e0; data 24; rejected and restored.
|
||||
- c78-cleanup-pud-switch: R8 plus pud-switch: restore rejection cursor paths and target source expression. Deficit 40 -> 12; engine fuzzy 80.25890% -> 81.51883; frame 0x4e0; data 24; rejected and restored.
|
||||
- c79-cleanup-oem-segments: R8 plus oem-segments: restore rejection cursor paths and target source expression. Deficit 40 -> 14; engine fuzzy 80.25890% -> 80.75281; frame 0x4e0; data 24; rejected and restored.
|
||||
- c80-cleanup-pud-segments: R8 plus pud-segments: restore rejection cursor paths and target source expression. Deficit 40 -> 21; engine fuzzy 80.25890% -> 80.44745; frame 0x4e0; data 24; rejected and restored.
|
||||
- c81-cleanup-context-segments: R8 plus context-segments: restore rejection cursor paths and target source expression. Deficit 40 -> 21; engine fuzzy 80.25890% -> 80.51086; frame 0x4e0; data 24; rejected and restored.
|
||||
- c82-cleanup-component-segments: R8 plus component-segments: restore rejection cursor paths and target source expression. Deficit 40 -> 19; engine fuzzy 80.25890% -> 80.47659; frame 0x4e0; data 24; rejected and restored.
|
||||
- c83-cleanup-context-phrase: R8 plus context-phrase: restore rejection cursor paths and target source expression. Deficit 40 -> 11; engine fuzzy 80.25890% -> 80.49812; frame 0x4e0; data 24; rejected and restored.
|
||||
- c84-cleanup-dictionary-phrase: R8 plus dictionary-phrase: restore rejection cursor paths and target source expression. Deficit 40 -> 15; engine fuzzy 80.25890% -> 80.62936; frame 0x4f0; data 72; kept.
|
||||
- c85-cleanup-global-phrase: R8 plus global-phrase: restore rejection cursor paths and target source expression. Deficit 15 -> 15; engine fuzzy 80.62936% -> 80.52173; frame 0x4f0; data 72; rejected and restored.
|
||||
- c86-cleanup-component-phrase: R8 plus component-phrase: restore rejection cursor paths and target source expression. Deficit 15 -> 15; engine fuzzy 80.62936% -> 80.55499; frame 0x4f0; data 72; rejected and restored.
|
||||
- c87-cleanup-user-duplicates: R8 plus user-duplicates: restore rejection cursor paths and target source expression. Deficit 15 -> 15; engine fuzzy 80.62936% -> 80.53438; frame 0x4f0; data 72; rejected and restored.
|
||||
- c88-cleanup-global-duplicates: R8 plus global-duplicates: restore rejection cursor paths and target source expression. Deficit 15 -> 12; engine fuzzy 80.62936% -> 80.55573; frame 0x4f0; data 72; kept.
|
||||
- c89-cleanup-phonetic-duplicates: R8 plus phonetic-duplicates: restore rejection cursor paths and target source expression. Deficit 12 -> 14; engine fuzzy 80.55573% -> 80.64556; frame 0x4f0; data 72; kept.
|
||||
- c90-cleanup-frequency-cleanup: R8 plus frequency-cleanup: restore rejection cursor paths and target source expression. Deficit 14 -> 2; engine fuzzy 80.64556% -> 81.07100; frame 0x4f0; data 72; kept.
|
||||
- c91-cleanup-engine-setup: R8 plus engine-setup: restore rejection cursor paths and target source expression. Deficit 2 -> 4; engine fuzzy 81.07100% -> 81.01171; frame 0x4e0; data 24; rejected and restored.
|
||||
- c92-cleanup-pair-bytes: R8 plus pair-bytes: restore rejection cursor paths and target source expression. Deficit 2 -> -2; engine fuzzy 81.07100% -> 81.04964; frame 0x4f0; data 72; rejected and restored.
|
||||
- c93-cleanup-pair-branches: R8 plus pair-branches: restore rejection cursor paths and target source expression. Deficit 2 -> 2; engine fuzzy 81.07100% -> 81.24812; frame 0x4f0; data 72; kept.
|
||||
- v0-oem-segment-view: oem: access component segment bytes through twelve-byte row fields. Deficit 2 -> 2; engine fuzzy 81.24812% -> 81.24812; frame 0x4f0; data 72; rejected and restored.
|
||||
- c94-pud-tone-match-status: R4: restore the target successful tone match status before PUD acceptance. Deficit 2 -> 0; engine fuzzy 81.24812% -> 81.35669; frame 0x4e0; data 96; kept.
|
||||
- v1-pud-segment-view: pud: access component segment bytes through twelve-byte row fields. Deficit 0 -> 0; engine fuzzy 81.35669% -> 81.35669; frame 0x4e0; data 96; rejected and restored.
|
||||
- v2-context-segment-view: context: access component segment bytes through twelve-byte row fields. Deficit 0 -> 0; engine fuzzy 81.35669% -> 81.35669; frame 0x4e0; data 96; rejected and restored.
|
||||
- w0-context-duplicate-wrap: context: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.35669% -> 81.36269; frame 0x4e0; data 96; kept.
|
||||
- w1-dictionary-duplicate-wrap: dictionary: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.13666%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w2-range-duplicate-wrap: range: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12795%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w3-ordinal-duplicate-wrap: ordinal: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12682%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w4-phonetic-ordinal-duplicate-wrap: phonetic-ordinal: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12682%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w5-user-duplicate-wrap: user: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12542%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w6-global-duplicate-wrap: global: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12495%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w7-component-duplicate-wrap: component: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12964%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w8-frequency-duplicate-wrap: frequency: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.36269%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w9-pair-duplicate-wrap: pair: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12299%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w10-phonetic-duplicate-wrap: phonetic: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.12814%; frame 0x4e0; data 96; rejected and restored.
|
||||
- w11-filtered-duplicate-wrap: filtered: branch on the incremented duplicate ring cursor at 64. Deficit 0 -> 0; engine fuzzy 81.36269% -> 81.14134%; frame 0x4e0; data 96; rejected and restored.
|
||||
|
||||
### Continuation audit
|
||||
|
||||
This round compiled 106 logged engine trials containing 105 distinct candidate sources; 37 improvements passed the quick gate and were committed separately. c18 repeats c15 exactly and does not count as a distinct attempt. Transform assertions and failed temporary script construction are excluded from these counts. The c45 low-byte-first change affects both the R7 character-range candidate count and R11 component first ordinal. c05 retry-capacity selection was superseded by c46; it is not a retained change.
|
||||
|
||||
Retained repairs cover R0 component-row addressing; R1 component cursor/count and context format setup; R3 OEM component-mode checks and spelling scan order; R4 tone-loop bounds, successful tone status and spelling scan order; R5 context word length and duplicate-ring wrap; R6 prediction emission, dictionary output cursor and phrase-offset decoding; R7 range duplicate branches and ordinal update; R8 direct ordinal duplicate exits, seen-ordinal scan and separate rejection cursor advancement; R10 global duplicate exits; R11/R12 separate charset setup and filtering; R12 frequency duplicate rejection advancement and component emission; R13 phonetic pair branch order; R14 phonetic-match failure and duplicate exits; R15 output termination and final phonetic retry state; R16 filtered ordinal decoding, count placement and output cursors.
|
||||
|
||||
The target and source both contain 10,676 instructions (0xa6d0 bytes): deficit 62 -> 0, engine fuzzy 78.76161% -> 81.362686%. Instruction-exact functions remain 5/8; matched code remains 4168/47816; matched data increases 72 -> 96/536. The frame is 0x4e0, but the source now saves four GPRs individually while the target calls _savegpr_27/_restgpr_27 for five. The instruction total includes cancellation between positive and negative regional differences; it does not establish an exact match or prove all semantic paths are recovered. Remaining engine differences include displaced branch/case bodies, register choices and stack-local offsets.
|
||||
|
||||
The final block map is /tmp/sol-med-zi8-r2/map.md and map.json, with 1796 target blocks and 1786 source blocks. Every block has instruction count, call targets and references. Calls number 168/166; the omitted save/restore helper calls account for the net difference. Call order also differs in displaced bodies. Pool comparison remains IDENTICAL, with no string pool or string references. aligned-blocks.md pairs 1240 target blocks; global.diff lists direct instruction alignment. There are 2309 call-anchored nonidentical intervals, including 222 positive and 228 negative instruction differences. These alignment intervals are not necessarily missing behavior. Every compiled trial retains its source, build output, pool result, focused diff and fresh maps in that directory.
|
||||
|
||||
The R0-R16 audit above still records at least three distinct compiled attempts for every target range. R15 finish actually begins at target +9838 and filtered-table handling at +9a68; the earlier +9be4/+9fb0 boundaries were approximate call groups. No target instructions are omitted from the complete map. The two other unmatched functions retain three distinct successful-build attempts each from s01-s03 and s04/s06/s07: Zi8GetElementCount 99.347824%, 115/115 instructions, thirteen register differences; ZiMatchZHSpelling 98.80165%, 121/121 instructions, 29 register differences. No new exact function was added, so the separate exact-function-count completion criterion is unmet.
|
||||
|
||||
Final readability cleanup changed whitespace and removed a redundant scope without changing the measured assembly. The deficit-zero stopping condition is met; branch experiments w0-w11 were then measured, with only the context duplicate wrap retained.
|
||||
|
||||
### Continuation clean gate
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 96/536 functions 5/8 fuzzy 83.3368 linked code 0
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 83.3368
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 97.91667
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 81.362686
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
|
||||
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 72 functions 5 fuzzy 81.0138
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 86.34483 -> 86.34483
|
||||
global fuzzy_match_percent: 98.91881 -> 98.95590
|
||||
global complete_code_percent: 60.34391 -> 60.34391
|
||||
global matched_data_percent: 90.91649 -> 90.91780
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user