Repository navigation
perf(binding): Port WinUI PropertyPathParser - #26586
MartinZikmund wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
This pull request is a draft, so it cannot be queued yet. Mark it as ready for review to get the box back. |
|
Claude finished @MartinZikmund's task in 31s —— View job Review of PR #26586: Port WinUI PropertyPathParser
Verdict: ship. I found no blocking issues, and I only read the diff. I did not build the PR or run its tests. Findings: 0 high, 0 medium, 1 low (inline: the non-ASCII digit classification vs conversion mismatch). What I checked
Notes
|
| => start == 0 && length == source.Length ? source : source.Substring(start, length); | ||
|
|
||
| // WinUI uses the CRT's C-locale wide-digit table, not the newer Unicode tables in .NET. | ||
| // Its classification includes digits that _wtoi cannot convert. |
There was a problem hiding this comment.
Low / question: IsWideDigit accepts ², ³, ¹ (and the other ranges missing from GetWideDigitValue, e.g. ߀ and ႐), but GetWideDigitValue returns -1 for them. So [²] is classified as an int indexer and ParseIntIndexer returns 0, and [5²] silently becomes 5. I understand this mirrors iswdigit plus _wtoi on WinUI, and the tests may already cover it. Because it turns what was a string indexer in Uno into a silent [0] lookup, a short comment saying the divergence is intentional parity would help the next reader avoid "fixing" it.
| if (lengths[i] == targetLength) | ||
| { | ||
| // Length matches - now do the full string comparison | ||
| if (name.SequenceEqual(s_commonPropertyNames[i])) | ||
| { | ||
| return s_commonPropertyNames[i]; | ||
| } | ||
| } |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247322 found UI Test snapshots differences: Details
|
Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
b4dddd0 to
6eba793
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248686 found UI Test snapshots differences: Details
|
GitHub Issue: Part of #24093
PR Type:
🔄 Refactoring
What changed? 🚀
Split out of #24094 (originally by @morning4coffe-dev), which now only carries the opt-in
XamlOptionalChangespart. This piece is always on, so it gets its own review.Ports WinUI's
PropertyPathParserandPropertyPathStepDescriptorallocation rework (fd139f17, mirrored from upstreammain3c9c168844f):Substring/Split/Replace/LINQ allocations.MetadataAPIgains span overloads for attached-property lookup.IsNumericIndexand the CRT'siswdigit/_wtoi. An empty index becomes a string indexer, supported non-ASCII digits can form integer indices, and overflowing indices saturate atint.MaxValue.Adds a
propertypatharea to the WinUI port sync (build/winui-sync/areas/propertypath.json). The ported files'MUX Referenceheaders carry no version, because the area file records it.Important
WIP: blocked until WinUI merges the rework into a stable release. The port mirrors upstream
main: fd139f17 ("Reduce allocations for PropertyPathParser") and ee197a29 ("Avoid more heap allocs for PropertyPaths"). Both are onmain/winui3/mainand in1.8.12, but not in the latest stable tagwinui3/release/2.7.0, which still ships the older (1.5.5-era) parser.2.7.0is not an ancestor ofwinui3/main.The area is recorded at
2.7.0for now, so the port is ahead of its baseline, andPropertyPathCommonNames.{h,cpp}can't be mapped upstream because they don't exist at that tag. Once a stable 2.x tag containsee197a29, this PR will be re-onboarded with/winui-sync-onboard: baseline moved to that tag,PropertyPathCommonNamesmapped on both sides, line-by-line review and workaround audit against it.Validation (rebased on
master11e833a)Uno.UI.UnitTests(net10.0 override, analyzers on): 0 warnings, 0 errors.Uno.UI.UnitTestssuite, 4,719 passed, 0 failed (Given_PropertyPathParser+Given_BindingPath: 97/97).propertypathup to date at2.7.0; tooling tests 138/138.Performance
Headless Skia app with Fluent resources (x64, net10.0,
DOTNET_TieredCompilation=0), one process per scenario, 4 interleaved A/B rounds againstmaster. Allocations are UI-thread bytes and exact: amaster-vs-masternull run drifted 0.00%. A time change is bold only when it is larger than that scenario's null drift and the A/B ranges don't overlap; anything else is marked noise. Background load on the machine made some timings noisy.{Binding}s (Name,Address.City,Tags[1])Tagset/getName/First.Second/Items[1024])ComboBox,DisplayMemberPathover DO items, 200 selectionsParsing a property path allocates half as much (−99 B per parse on average across the three shapes) and runs a third faster. The visual-state saving (−244 B per state change, −13%) comes from this PR's
BindingPathproperty-name comparison changes, whichVisualStateGroupruns on every state change.{Binding}and the DisplayMemberPath scenario are unchanged.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX