Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6f59f9f
Stabilize parallel optimizer Val iteration for deterministic names (#…
T-Gro May 26, 2026
2b39c15
Add Val.Stamp tiebreaker to sort keys; fix release note
T-Gro May 27, 2026
151f443
Address self-review: extract helper, trim prose, run determinism in R…
T-Gro May 28, 2026
c067580
Retrigger CI
T-Gro May 28, 2026
e44ee25
Revert CI to Debug config, add multi-file determinism regression test
T-Gro May 28, 2026
6f8ba18
Re-enable Determinism_Release CI
T-Gro May 29, 2026
1498292
Make TypeDefsBuilder emit order deterministic under parallel codegen
T-Gro May 31, 2026
684b291
Stabilize extra binding emit order and parallel FileIndex assignment
T-Gro May 31, 2026
e279b7e
Update release note to cover full determinism scope
T-Gro May 31, 2026
a629ee6
Stabilize IL emit order across --parallelcompilation+/-
T-Gro Jun 1, 2026
609540e
Round 1 review fixes: tighter code, debug-assert tiebreaker safety, t…
T-Gro Jun 1, 2026
7f5fe7a
Round 2 review fixes: drop speculative locks, drop unsound assertion,…
T-Gro Jun 1, 2026
55d983d
Merge remote-tracking branch 'origin/main' into HEAD
T-Gro Jun 1, 2026
2e30a0a
Update net472 anon-record IL baselines and trimmed size
T-Gro Jun 1, 2026
27718b2
test-determinism: add seq-vs-par mode for 1-shot deterministic diff
T-Gro Jun 1, 2026
1ad8183
CI: add seq-vs-par determinism leg alongside the race detector
T-Gro Jun 1, 2026
4e1b248
Remove .scratch/ files accidentally included in previous commit
T-Gro Jun 1, 2026
87cdc4c
CI: mark seq-vs-par determinism leg as informational (continueOnError)
T-Gro Jun 2, 2026
b28c598
Revert "CI: mark seq-vs-par determinism leg as informational (continu…
T-Gro Jun 2, 2026
3ed584d
Revert "Update net472 anon-record IL baselines and trimmed size"
T-Gro Jun 2, 2026
ecc5eaa
Revert "Round 2 review fixes: drop speculative locks, drop unsound as…
T-Gro Jun 2, 2026
f6006be
Revert "Round 1 review fixes: tighter code, debug-assert tiebreaker s…
T-Gro Jun 2, 2026
5a6226a
Revert "Stabilize IL emit order across --parallelcompilation+/-"
T-Gro Jun 2, 2026
27f854c
Revert "Stabilize extra binding emit order and parallel FileIndex ass…
T-Gro Jun 2, 2026
903471b
Revert "Make TypeDefsBuilder emit order deterministic under parallel …
T-Gro Jun 2, 2026
0976278
Merge remote-tracking branch 'origin/main' into pr-19810
T-Gro Jun 2, 2026
602f23c
Option B: per-ImplFile naming scope + deterministic FileIndex pre-reg…
T-Gro Jun 2, 2026
97a5d76
Bucket compiler-generated names by emitting file for parallel determi…
T-Gro Jun 2, 2026
67c14fd
Revert "Bucket compiler-generated names by emitting file for parallel…
T-Gro Jun 2, 2026
83eb8eb
Reapply IlxGen emit-order determinism and per-file CodegenNamingScope
Jun 3, 2026
d688459
Merge remote-tracking branch 'origin/main' into fix-deterministic-str…
Jun 3, 2026
d406e33
Fix CodegenNamingScope: use actual FileIndex and Lazy for determinism
Jun 3, 2026
04d034a
Merge remote-tracking branch 'origin/main' into fix-deterministic-str…
Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ tests/projects/CompilerCompat/local-nuget-packages/
tests/projects/CompilerCompat/lib-output-*/
tests/projects/CompilerCompat/**/bin/
tests/projects/CompilerCompat/**/obj/
.scratch/
21 changes: 7 additions & 14 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CI and PR triggers

Check failure on line 1 in azure-pipelines-PR.yml

View check run for this annotation

Azure Pipelines / fsharp-ci (Build IcedTasks_Test_Release Regression Test)

azure-pipelines-PR.yml#L1

azure-pipelines-PR.yml(,): error : Regression test failed: IcedTasks_Test_Release
trigger:
branches:
include:
Expand Down Expand Up @@ -100,7 +100,7 @@
helixRepo: dotnet/fsharp
jobs:
# Determinism, we want to run it only in PR builds
- job: Determinism_Debug
- job: Determinism_Release
condition: eq(variables['Build.Reason'], 'PullRequest')
variables:
- name: _SignType
Expand All @@ -109,13 +109,6 @@
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(_WindowsMachineQueueName)
timeoutInMinutes: 90
strategy:
maxParallel: 2
matrix:
regular:
_experimental_flag: ''
experimental_features:
_experimental_flag: ''
steps:
- checkout: self
clean: true
Expand All @@ -129,15 +122,15 @@
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Build.SourcesDirectory)/.dotnet
- script: .\eng\common\dotnet.cmd
- script: .\eng\test-determinism.cmd -configuration Debug
env:
FSHARP_EXPERIMENTAL_FEATURES: $(_experimental_flag)
displayName: Determinism tests with Debug configuration
- script: .\eng\test-determinism.cmd -configuration Release
displayName: Determinism tests (race detector — same flags both builds)
- script: .\eng\test-determinism.cmd -configuration Release -mode seq-vs-par
displayName: Determinism tests (1-shot diff — sequential vs parallel)
- task: PublishPipelineArtifact@1
displayName: Publish Determinism Logs
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/log/Debug'
artifactName: 'Determinism_Debug Attempt $(System.JobAttempt) Logs'
targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release'
artifactName: 'Determinism_Release Attempt $(System.JobAttempt) Logs'
continueOnError: true
condition: not(succeeded())

Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Fixed

* Stabilize codegen order under `--parallelcompilation+` so `--deterministic` Release builds produce byte-identical IL across rebuilds: optimizer Val iteration, IlxGen type/method/field/event emit order, anonymous-record extra-binding drain, and `FileIndex` assignment now follow source position rather than thread-scheduling order. Compiler-generated names are also bucketed by the file being optimized/emitted (per-file naming scope) rather than by inlined source location, so parallel optimization and code generation no longer race on a shared name counter. ([Issue #19732](https://github.com/dotnet/fsharp/issues/19732), [PR #19810](https://github.com/dotnet/fsharp/pull/19810))
* Deduplicate format specifier locations in computation expressions so editor tooling no longer reports duplicate entries for the same `%` specifier. ([Issue #16419](https://github.com/dotnet/fsharp/issues/16419), [PR #19791](https://github.com/dotnet/fsharp/pull/19791))
* Reject non-function bindings for single-case and partial active pattern names with FS1209, matching the existing multi-case behavior. ([PR #19763](https://github.com/dotnet/fsharp/pull/19763))
* Fix FS0421 "The address of the variable cannot be used at this point" incorrectly raised for the discard pattern `let _ = &expr` when `let x = &expr` compiles. ([Issue #18841](https://github.com/dotnet/fsharp/issues/18841), [PR #19811](https://github.com/dotnet/fsharp/pull/19811))
Expand Down
37 changes: 31 additions & 6 deletions eng/test-determinism.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
param([string]$configuration = "Debug",
[string]$msbuildEngine = "vs",
[string]$altRootDrive = "q:",
[ValidateSet("same", "seq-vs-par")]
[string]$mode = "same",
[switch]$help,
[switch]$norestore,
[switch]$rebuild)
Expand All @@ -15,6 +17,8 @@ function Print-Usage() {
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
Write-Host " -bootstrapDir Directory containing the bootstrap compiler"
Write-Host " -altRootDrive The drive we build on (via subst) for verifying pathmap implementation"
Write-Host " -mode <value> 'same' (default): build twice with identical flags (race-detector)"
Write-Host " 'seq-vs-par': first build sequential, second build parallel (deterministic 1-shot diff)"
}

if ($help) {
Expand All @@ -25,7 +29,7 @@ if ($help) {
# List of binary names that should be skipped because they have a known issue that
# makes them non-deterministic.
$script:skipList = @()
function Run-Build([string]$rootDir, [string]$increment) {
function Run-Build([string]$rootDir, [string]$increment, [string]$additionalFscFlags = "") {

$logFileName = $increment

Expand Down Expand Up @@ -62,6 +66,9 @@ function Run-Build([string]$rootDir, [string]$increment) {
Stop-Processes

Write-Host "Building $solution using $bootstrapDir into '$increment' $incrementDir"
if ($additionalFscFlags -ne "") {
Write-Host " AdditionalFscCmdFlags = '$additionalFscFlags'"
}
MSBuild $toolsetBuildProj `
/p:Configuration=$configuration `
/p:Projects=$solution `
Expand All @@ -86,6 +93,7 @@ function Run-Build([string]$rootDir, [string]$increment) {
/p:RunAnalyzers=false `
/p:RunAnalyzersDuringBuild=false `
/p:BUILDING_USING_DOTNET=false `
/p:AdditionalFscCmdFlags="$additionalFscFlags" `
/bl:$logFilePath

Write-Host "Copy-Item -Path $binDir -Destination $incrementDir -ErrorAction SilentlyContinue -Recurse"
Expand Down Expand Up @@ -202,9 +210,9 @@ function Test-MapContents($dataMap) {
}
}

function Test-Build([string]$rootDir, $dataMap, [string]$increment) {
function Test-Build([string]$rootDir, $dataMap, [string]$increment, [string]$additionalFscFlags = "") {
$logFileName = $increment
Run-Build $rootDir -increment $increment
Run-Build $rootDir -increment $increment -additionalFscFlags $additionalFscFlags

$errorList = @()
$allGood = $true
Expand Down Expand Up @@ -273,14 +281,31 @@ function Test-Build([string]$rootDir, $dataMap, [string]$increment) {
}

function Run-Test() {
$seqFlags = ""
$parFlags = ""
if ($mode -eq "seq-vs-par") {
# First build: sequential (force single-threaded, disable any parallel test paths)
$seqFlags = "--parallelcompilation- --test:ParallelOff --nowarn:75"
# Second build: parallel (default in modern fsc, made explicit for clarity)
$parFlags = "--parallelcompilation+"
Write-Host "Determinism mode: seq-vs-par"
Write-Host " Initial (seq): $seqFlags"
Write-Host " Test1 (par): $parFlags"
}
else {
Write-Host "Determinism mode: same (race-detector; both builds identical)"
}

# Run the initial build so that we can populate the maps
Run-Build $RepoRoot -increment "Initial" -useBootstrap
Run-Build $RepoRoot -increment "Initial" -additionalFscFlags $seqFlags

$dataMap = Record-Binaries $RepoRoot "Initial"
Test-MapContents $dataMap

# Run a test against the source in the same directory location
Test-Build -rootDir $RepoRoot -dataMap $dataMap -increment "Test1"
# Run a test against the source in the same directory location.
# In 'same' mode: same flags as Initial (probabilistic race detector).
# In 'seq-vs-par' mode: parallel flags, contrasting against the sequential Initial.
Test-Build -rootDir $RepoRoot -dataMap $dataMap -increment "Test1" -additionalFscFlags $parFlags

# Run another build in a different source location and verify that path mapping
# allows the build to be identical. To do this we'll copy the entire source
Expand Down
Loading
Loading