Skip to content

Compile indexer reads with exception-region arguments - #617

Merged
dadhi merged 1 commit into
dadhi:masterfrom
jogibear9988:fix/indexer-read-exceptions-standalone
Nov 10, 2026
Merged

dadhi merged 1 commit into
dadhi:masterfrom
jogibear9988:fix/indexer-read-exceptions-standalone

Conversation

@jogibear9988

Copy link
Copy Markdown
Contributor

Indexer reads with a try/finally argument currently return null from strict compilation. Use a small operand-emission helper to spill the receiver and indices when the existing collection metadata marks that index expression.

Receiver and index evaluation order, cleanup, null receivers, throwing indices and supported compiler flags. The parity test now expects strict compilation for reads; assignment fallback expectations remain. Regressions use strict FEC compilation for both Standard and LightExpression.

Validation

Release solution build: zero warnings/errors.

Runtime TestX groups Legacy tests
.NET 10 443 passed 1,756 passed
.NET 8 443 passed 1,755 passed
.NET Framework 4.7.2 422 passed 1,639 passed

Measurements

Current master f1d2fb33 → this change, Release, Windows ARM64, .NET 8.0.28 / 10.0.9. Compilation uses prebuilt trees; runtime measures invocation through the same wrapper. Two fresh process rounds with reversed load order, seven samples per round, about 30 ms calibration, one logical CPU and tiered compilation disabled. Tables use the median of the two per-round medians.

The controls below produce correct results on master for their measured inputs. Newly supported trees have no valid before/after execution comparison because master rejects them, produces incorrect results or emits invalid IL. Timings include machine and JIT/code-placement variation; the unchanged add control helps show that variation. These observations do not prove universal performance neutrality.

net8.0 results (master → change)
API / workload Compile ns Invoke ns Compile B/op Invoke B/op
Standard / add_control 1170.7 → 1155.5 2.4 → 2.4 872.0 → 872.0 0.0 → 0.0
Standard / list_read 1755.9 → 1893.1 2.3 → 2.2 952.0 → 952.0 0.0 → 0.0
Standard / list_read_unrelated_try 2477.4 → 2709.9 2.2 → 2.2 1552.0 → 1552.0 0.0 → 0.0
Light / add_control 1293.2 → 1527.3 2.4 → 2.5 872.0 → 872.0 0.0 → 0.0
Light / list_read 1720.3 → 1747.9 2.7 → 2.5 952.0 → 952.0 0.0 → 0.0
Light / list_read_unrelated_try 2216.8 → 2218.8 2.2 → 2.3 1552.0 → 1552.0 0.0 → 0.0
net10.0 results (master → change)
API / workload Compile ns Invoke ns Compile B/op Invoke B/op
Standard / add_control 3763.3 → 3480.0 2.3 → 2.2 872.0 → 872.0 0.0 → 0.0
Standard / list_read 4320.7 → 4379.8 2.3 → 1.9 952.0 → 952.0 0.0 → 0.0
Standard / list_read_unrelated_try 5810.0 → 6270.3 2.0 → 2.0 1552.1 → 1552.1 0.0 → 0.0
Light / add_control 2906.3 → 2832.6 2.2 → 2.1 872.0 → 872.0 0.0 → 0.0
Light / list_read 3260.9 → 3404.7 1.9 → 1.9 952.0 → 952.0 0.0 → 0.0
Light / list_read_unrelated_try 3541.4 → 3794.5 1.8 → 1.8 1552.0 → 1552.0 0.0 → 0.0

Emitted IL differs in these measured workloads: none.
No measured allocation increase above 0.1 B/op in these controls.

Indexer reads with a try/finally argument currently return null from strict compilation. Use a small operand-emission helper to spill the receiver and indices when the existing collection metadata marks that index expression.
@dadhi
dadhi merged commit 831ac63 into dadhi:master Nov 10, 2026
4 checks passed
@jogibear9988
jogibear9988 deleted the fix/indexer-read-exceptions-standalone branch November 10, 2026 13:34
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.

2 participants