Repository navigation
Preserve both bytes of ref char reads and writes - #572
Closed
jogibear9988 wants to merge 2 commits into
Closed
jogibear9988 wants to merge 2 commits into
jogibear9988 wants to merge 2 commits into
Conversation
dadhi
added a commit
that referenced
this pull request
Nov 2, 2026
Owner
|
I have steal this PR and implemented it directly. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use ldind.u2/stind.i2 for char managed references. The byte-sized opcodes currently truncate non-ASCII reads and leave the old high byte behind on writes.
Two production opcode replacements. Two regression methods per expression flavor cover all read/write combinations of eight boundary values, including surrogate code units.
Independent extraction from #558, based directly on
dadhi/master6702eab6. It requires neither #558 nor either of the other standalone fixes. All six merge orders of the three standalone fixes were checked without conflicts. #558 is unchanged.Validation
Focused regressions: 4 methods passed per runtime, covering Standard and LightExpression on .NET 8, .NET 10, and .NET Framework 4.7.2. Loading the untouched master compiler with the same regression assembly reproduces the failure on .NET 8. All three Release solution builds pass with zero warnings/errors.
Full .NET 8/.NET 10 native runners were also executed. Each reports the same existing failure in
LightExpressionTests.Binary_operators_with_methods_and_nullable_operands_are_the_same_as_system(two nullable MultiplyChecked rows produce OverflowException). The identical failure reproduces on untouched master; no new full-run failures were observed. No tests are skipped or weakened to obtain this result.Performance and allocations
Windows ARM64, Release, SDK 10.0.301. Before and after compiler assemblies are loaded in separate AssemblyLoadContexts in the same process. Nine alternating-order samples per phase, common operation counts, approximately 35 ms per side, warmed delegates, tiering disabled, and the process pinned to one available logical CPU. GC runs outside samples and a no-GC region isolates allocation throughput. Compilation reuses prebuilt expression trees; execution reuses compiled delegates. This measures CompileFast and delegate invocation, not tree construction. Ratios for previously incorrect/invalid cases are intentionally not claimed.
Allocation counts are unchanged on every shared workload measured, for both compilation and invocation. The raw timing samples and all unchanged controls are retained: small timing differences and code-placement/host variation do not establish universal throughput parity. These are correctness fixes with no new runtime helper calls or storage allocations; no broad performance improvement is claimed.
No affected row has a paired-sample bootstrap interval wholly above parity. These descriptive intervals, stored with the raw data, are based on nine temporal samples and are not a universal performance guarantee.
Raw samples, harness sources, source hashes and validation logs are committed in
test/FastExpressionCompiler.Benchmarks/results/standalone-byref-char/evidence.zip. Earlier separate-process timing attempts had unstable unchanged controls; their raw results are retained as exploratory evidence and are not the final paired comparison.