Repository navigation
Pilot host-issued exact-match presentation - #10037
richlander wants to merge 3 commits into
Conversation
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>
|
Round 1 carry-forward for candidate head Before reviewer dispatch, Classification: no interaction. The candidate head remains unchanged and its exact-head NativeAOT evidence remains applicable. Auto-merge is unarmed. Review waits for current-head |
|
Closing this prototype because its comparison answers the wrong performance question. The candidate path reused host text, but the baseline decoded every matching UTF-8 Name into a new No review was dispatched and auto-merge was never armed. The replacement plan is two independently reviewable slices: first adopt |
Host-issued exact-match presentation pilot
dotnet-inspectbuilds robust, capable inspection features that providefoundational capabilities or compelling experiences and are conventionally
sound, delightfully new or unique, or both.
This final prototype slice tests a narrow consequence of byte-native names:
when a host-issued user value exactly matches a stored Name, presentation can
reuse the original host text instead of decoding and containing the matched
artifact bytes.
Stack
Both parent slices are merged. This PR targets
mainand tracks #9918.Design basis
Normative owner:
docs/design/inert-bytes.md#UTF-8-query-operationsowns byte-exact closed comparison without decoding or promoting stored bytes.
The pilot adds an explicit provenance shape:
UserSearchValueis constructed at the host boundary and retains theoriginal text plus one UTF-8 encoding.
Utf8RangeReader.TryMatchUserTextperforms the same byte-exact comparison.UserTextMatch, whose presentation is the original hosttext; it does not expose or strengthen the opaque artifact range.
The type makes construction sites easy to audit. It is not a capability barrier
against trusted in-process code, and it does not admit artifact-derived,
normalized, fuzzy, prefix, case-insensitive, or arbitrary UTF-8 promotion.
Measurement
present --user-text <text>compares two paths over the samepopulation-backed store:
ScanAndPresentMatchedNamePresentationUserTextMatchThe second scenario isolates the post-match work that a large scan can hide.
The baseline uses current UTF-16
InertStringas a stand-in for the plannedInertUtf8String; product adoption must compare against that real currencyonce it exists.
Exact-head NativeAOT evidence
Measured code commit
8b61ed18e28103843d238eeaec42cd71c94bffcfran as linux-x64 NativeAOT on
dotnet-inspect-perfunder oneperf-guardlease. The host was 99.75% idle. Thirty rotated rounds used
.ctorover atleast 50,000 keys per asset. Binary SHA-256:
885ee6954f968bdfd70e044b46f1b636e024968546fec57b4ef239909fefad5b.Ratios are
ReuseHostText / DecodeAndContain:Matched-presentation control intervals were 0.079x-0.159x,
0.088x-0.161x, and 0.106x-0.142x. Full scan-and-presentation intervals were
0.883x-0.961x, 0.884x-0.957x, and 0.727x-1.026x. Candidate timed allocation was
zero in every cell; the isolated baseline allocated 32 bytes per operation.
Every baseline and candidate cell produced identical output.
Head
c3dfb224511a0ca06b69b0da81bd11d785394890adds only the evidence recordabove measured commit
8b61ed18e; no compiled source changed after the exactrun.
Decision boundary
The shortcut has a clear post-match benefit and can materially help when one
query presents many exact matches. It does not establish a general scan-speed
win. This evidence supports carrying the explicit host-input type into product
design; it does not authorize promoting matched opaque ranges into trusted text
or bypassing
InertUtf8Stringfor non-user provenance.Validation