Skip to content

Reserve typed label storage before backward jumps - #623

Open
jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/backward-typed-labels-independent
Open

jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/backward-typed-labels-independent

Conversation

@jogibear9988

Copy link
Copy Markdown
Contributor

A typed label encountered before its backward jumps can lack a result local and return label. Reserve both when emitting the label, so later jumps reuse the same storage and target.

Backward Return, Goto and Break to typed labels, compared with System compilation across compiler flags. Regressions require strict FEC compilation. Native suites cover Standard and LightExpression.

Validation

Local validation uses master baseline 094d067 plus this change. Release solution build: zero warnings/errors.

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

Measurements

Master baseline 094d0678 → 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 1504.5 → 1472.1 2.6 → 2.6 872.0 → 872.0 0.0 → 0.0
Standard / forward_label 1849.5 → 1651.2 2.5 → 2.4 1048.0 → 1048.0 0.0 → 0.0
Standard / label_value 1335.8 → 1451.1 2.6 → 2.5 920.0 → 920.0 0.0 → 0.0
Light / add_control 1358.4 → 1313.2 2.5 → 2.4 872.0 → 872.0 0.0 → 0.0
Light / forward_label 1887.5 → 1790.6 2.4 → 2.5 1048.0 → 1048.0 0.0 → 0.0
Light / label_value 1585.9 → 1286.9 2.7 → 2.8 920.0 → 920.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 5856.7 → 5138.5 3.0 → 3.1 872.1 → 872.1 0.0 → 0.0
Standard / forward_label 6350.3 → 6570.4 2.9 → 2.7 1048.1 → 1048.1 0.0 → 0.0
Standard / label_value 3946.6 → 4235.6 2.5 → 2.6 920.0 → 920.0 0.0 → 0.0
Light / add_control 4610.3 → 4697.8 2.8 → 2.9 872.1 → 872.1 0.0 → 0.0
Light / forward_label 4426.6 → 5423.8 3.1 → 3.1 1048.0 → 1048.0 0.0 → 0.0
Light / label_value 2556.8 → 2546.0 2.7 → 2.7 920.0 → 920.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.

A typed label encountered before its backward jumps can lack a result local and return label. Reserve both when emitting the label, so later jumps reuse the same storage and target.

Validation: Release solution build; full Standard and LightExpression .NET 8, .NET 10 and Framework runners pass.

Measurements: master 094d067 versus this change, compilation and invocation, both APIs, .NET 8/10, two opposite-order process rounds with seven samples each. No measured allocation increase above 0.1 B/op in the selected working controls. Timings and emitted IL are recorded in the PR description; these controls do not establish universal performance neutrality.
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