Skip to content

Add Prime and Nu to regression test matrix; fix graph resolution Module+Module merge - #19280

Merged
T-Gro merged 11 commits into
mainfrom
copilot/add-fsharp-test-entries
Feb 18, 2026
Merged

Add Prime and Nu to regression test matrix; fix graph resolution Module+Module merge#19280
T-Gro merged 11 commits into
mainfrom
copilot/add-fsharp-test-entries

Conversation

CopilotAI commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two F# projects to the regression test pipeline, and fixes a bug discovered through them in graph-based parallel type checking.

Bug fix: Module+Module merge in TrieMapping

When two files in the same namespace define a module with the same name (a legal F# pattern using CompilationRepresentationFlags.ModuleSuffix), the trie-based dependency graph failed to merge them. The second Module node silently replaced the first, losing its file index. Files in child namespaces that open-ed the parent then got an incomplete dependency set, leading to type-check errors under parallel compilation (graph-based checking).

Problematic pattern from the Nu game engine

// Assets.fsnamespaceNu[<RequireQualifiedAccess>]moduleAssets =moduleDefault =letPackageName="Default"letBlackName="Black"// WorldAssets.fsnamespaceNu[<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]moduleAssets =moduleDefault =letBlack= asset<Image> PackageName Assets.Default.BlackName
// WorldConstants.fsnamespaceNu.ConstantsopenNumoduleDissolve =letDefault={ DissolveImage = Assets.Default.Black }// ← could fail: file dependency on WorldAssets.fs was lost

Fix

Added a Module(_,file1), Module(_,file2) match arm in mergeTrieNodes that promotes the pair to a Namespace node, preserving both file indices—matching the existing Module, Namespace handling.

Regression test matrix

Added to azure-pipelines-PR.yml:

  • bryanedds/Prime @ 8d55f4e8e1d76e42f5fb3c9ba69eb79fe695e9fa
  • bryanedds/Nu @ b35cbe02029e0e33d72a4846816cf22714eb3aac

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
CopilotAI changed the title [WIP] Add two F# projects to regression test matrixAdd Prime and Nu to compiler regression test matrixFeb 12, 2026
CopilotAI requested a review from T-GroFebruary 12, 2026 10:35
When two files define the same module name in the same namespace
(e.g., module Assets in namespace Nu across Core/Assets.fs and
World/WorldAssets.fs), mergeTrieNodes' fallback case kept only the
first file's index, losing the second. This caused missing dependency
edges in the graph-based parallel type checker, leading to FS0039
errors when files were typechecked before their dependencies.
Fix: Add an explicit Module+Module case that promotes to a Namespace
node preserving both file indices in filesThatExposeTypes, following
the existing Module+Namespace merge pattern.
Added three test scenarios covering sub-namespace access patterns
and the duplicate module name case.
- Add scenario for type constructor usage through open parent namespace
- Add scenario for multiple namespace declarations in one file with AutoOpen
- Add descriptive comments explaining test groups and Module+Module fix rationale
- All 48 dependency resolution tests and 96 compilation tests pass
Address TEST-COVERAGE gap: the existing 'Two modules with the same name'
test only had 2 files, so mkTrie (which skips the last file) never
exercised the Module+Module merge branch in mergeTrieNodes.
Add three targeted tests:
- Module+Module merge preserves both file indices (3 files)
- Module+Module merge across three files (4 files, 3 sharing name)
- Module+Module merge preserves children from both sides
- TrieMappingTests: Assert merged node is Namespace with correct
filesThatExposeTypes (not just Files property)
- DependencyResolutionTests: Add focused test verifying Module+Module
merge creates dependency edges to both defining files
- Remove standalone Module+Module merge Fact test from
DependencyResolutionTests.fs (duplicated scenario-based coverage,
used Contains instead of set equality)
- Extract assertModuleMergePromotesToNamespace helper in TrieMappingTests
- Combine 2-file and 3-file Module+Module merge tests into a single
parameterized Theory test
@github-actions

github-actionsBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Change pathRelease notes pathDescription
src/Compilerdocs/release-notes/.FSharp.Compiler.Service/10.0.300.md

@T-Gro
T-Gro marked this pull request as ready for review February 12, 2026 18:42
@T-Gro
T-Gro requested a review from a team as a code ownerFebruary 12, 2026 18:42
@T-GroT-Gro changed the title Add Prime and Nu to compiler regression test matrixAdd Prime and Nu to regression test matrix; fix graph resolution Module+Module mergeFeb 12, 2026
@T-Gro
T-Gro requested a review from abonieFebruary 12, 2026 18:56
@T-Gro
T-Gro enabled auto-merge (squash) February 12, 2026 18:56
@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingFeb 18, 2026
@T-Gro
T-Gro merged commit 5fd82bc into mainFeb 18, 2026
50 checks passed
T-Gro added a commit that referenced this pull request Mar 2, 2026
- Restore docs/release-notes/.Language/11.0.md (DIM hierarchy notes from PR #19241)
- Restore docs/release-notes/.FSharp.Compiler.Service/10.0.300.md entries
(Nullness fixes PR #19262, graph-based checking PR #19280, semantic
classification PR #19311, type checker recovery PR #19314, overload
resolution cache)
- Add trailing newline to Operators.fs
- Remove untracked docs/RFC_Review.md review artifact
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
T-Gro added a commit that referenced this pull request Mar 2, 2026
Restore files to match main to fix NO-LEFTOVERS and TEST-CODE-QUALITY verifier failures:
- TrieMapping.fs: Restore Module+Module merge fix from PR #19280
- Release notes: Restore missing entries from PRs #19297, #19347, #19329
- XunitHelpers.fs: Restore deleted file
- XunitSetup.fs: Restore to main version
- TestConsole.fs: Restore to main version
- CompilerAssert.fs: Restore to main version
- FSharp.Test.Utilities.fsproj: Restore XunitHelpers reference
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants

@abonie@T-Gro