Skip to content

[AI] Normalize validator input before scoring#34

Merged
sochalewski merged 1 commit into
mainfrom
normalization
Jul 7, 2026
Merged

[AI] Normalize validator input before scoring#34
sochalewski merged 1 commit into
mainfrom
normalization

Conversation

@sochalewski

Copy link
Copy Markdown
Owner

Summary

Normalize validator input before DAWG lookup and scoring, including canonical precomposition, lowercasing, and deterministic French diacritic folding with fr_FR.

Move decomposed Unicode handling out of Language.points(for:), keeping scoring optimized for normalized inputs and DAWG-produced words.

Update Scripts/points-performance and docs so the scoring benchmark measures normalized scoring inputs instead of raw decomposed input.

Why

Raw decomposed Unicode should be handled at user-input boundaries, not inside the scoring hot path that runs across search results.

Impact

Validator.check, words(from:), and regex(phrase:) now share the same normalization path before dictionary lookup. Language.points(for:) is simpler and avoids precomposition fallback work. The points benchmark now reports realistic scoring workloads and checksum status.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Points performance

Results

PointsPerformance comparison

Base Compare Build Iterations Samples
db8eda7 7e4dda3 swiftc -O -whole-module-optimization 200000 5

Language.points(for:) Time

Median ns/word, lower is better.

Workload Base Compare Delta Change Samples Checksum
English ASCII 58.18 58.99 +0.82 +1.40% 5/5 ok
English short results 35.08 37.54 +2.46 +7.01% 5/5 ok
French normalized 52.43 54.72 +2.29 +4.37% 5/5 ok
Polish composed 125.45 139.61 +14.16 +11.29% 5/5 ok
Geomean +5.95%

@sochalewski

Copy link
Copy Markdown
Owner Author

PointsPerformance comparison

Base Compare Build Iterations Samples
924f9e0 7e4dda3 swiftc -O -whole-module-optimization 200000 5

Language.points(for:) Time

Median ns/word, lower is better.

Workload Base Compare Delta Change Samples Checksum
English ASCII 171.61 32.29 -139.32 -81.18% 5/5 ok
English short results 108.32 19.38 -88.95 -82.11% 5/5 ok
French normalized 153.50 26.12 -127.38 -82.98% 5/5 ok
Polish composed 243.88 72.12 -171.76 -70.43% 5/5 ok
Geomean -79.71%

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.77%. Comparing base (db8eda7) to head (7e4dda3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   93.70%   93.77%   +0.06%     
==========================================
  Files          35       35              
  Lines        1875     1862      -13     
==========================================
- Hits         1757     1746      -11     
+ Misses        118      116       -2     
Flag Coverage Δ
ios 93.77% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
Scrabbdict/Extensions/Language+Extension.swift 95.23% <100.00%> (+2.21%) ⬆️
Scrabbdict/Models/Language.swift 100.00% <100.00%> (ø)
Scrabbdict/Services/Validator.swift 84.44% <100.00%> (+2.86%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sochalewski sochalewski enabled auto-merge (squash) July 7, 2026 14:09
@sochalewski sochalewski disabled auto-merge July 7, 2026 14:09
@sochalewski sochalewski merged commit 346ce58 into main Jul 7, 2026
14 of 15 checks passed
@sochalewski sochalewski deleted the normalization branch July 7, 2026 14:10
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.

1 participant