Skip to content

Name packages by their logical identity in module identities - #1450

Merged
julia-script merged 5 commits into
selfhostfrom
selfhost-module-identity-root
Oct 11, 2026
Merged

julia-script merged 5 commits into
selfhostfrom
selfhost-module-identity-root

Conversation

@julia-script

@julia-script julia-script commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Every native module identity was ("file", <absolute package root>, logical path) (ModuleSources.silk), so instance keys, symbol hashes and the emitted LLVM IR changed with the checkout's directory. The same compiler building the same sources from two directories emitted different IR. The Linux seed chain hid it because N1 and N2 build from one path. The macOS leg (#1445), which compares IR emitted on two machines, exposed it.

The reference already rules this out: module identity "is logical rather than an absolute host path" (MODULE-001), and a package's identity is name@version, "Physical checkout paths are not identities" (PROFILE-002).

  • The package component is now the manifest's [package].name, followed by @version when [package].version is declared. Corpus and harness manifests declare no version (a guarded input), so the version stays optional. A missing or empty name, or a non-text version, is InvalidSourceRoot.
  • An entry with no silk.toml in its directory or any parent fails with the new MissingManifest {directory}, as the bootstrap CLI refuses with ManifestNotFound. The old fallback used the entry's directory as the identity. silkc reports it as silkc: no silk.toml in <directory> or any parent directory; a build needs a package manifest.
  • Execution-storage bindings from a composition or the catalog use the same logical package.
  • The filesystem root is still used only to read files.
  • SemanticLoweringCases.silk gains packageIdentityExcludesTheCheckoutDirectory. It builds one tiny composed package from two different directories and asserts equal entry identities and byte-identical LLVM IR. It also asserts name@version, and that a manifest-less entry fails with MissingManifest naming its own directory. It sits beside the existing composition case, so it adds no test file.
  • compiler/README.md describes package identity. diagnostic_main.silk and StrictInventoryCases.silk get the new error in their rows. Those two files already call a two-argument ModuleSources.make that no longer exists, and no workflow builds them.

Validation on head c5212d7 (selfhost with #1447 merged in)

  • CI: every check is green, including "Native seed chain (N2 fixpoint)".
  • Local bootstrap compile, as required for compiler-changing PRs: node packages/cli/dist/bin.js test --manifest-path compiler/silk.toml --root src/semantic/SemanticLoweringCases.silk --no-cache gives 125 passed, 0 failed, including the new case (21 min, 11.9 GB peak RSS).
  • Local seed-built N1 of this branch:
    • silkc test src/semantic/SemanticLoweringCases.silk --filter ackageIdentity passes.
    • The same case against the old ModuleSources.silk fails.
    • A manifest-less build prints the message above and exits 1.
  • On the pre-merge head, the compiler's own IR emitted from two different directories was byte-identical (sha256 a160c351…). Before this change it differed at the first package symbol. A small package gave identical IR with relative and with absolute entry paths.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA

Every native module identity carried the package root's absolute directory, so
symbol hashes and the emitted LLVM IR changed with the checkout location. The
package component is now the manifest's [package].name, or name@version when a
version is declared (PROFILE-002). An entry with no manifest has no package
identity and is refused, as the bootstrap CLI does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
Without one and without a library catalog, reading the package selects no runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
An entry with no silk.toml in its directory or any parent now fails with
MissingManifest, carrying the directory the upward search started from, and
silkc reports it instead of a generic invalid source root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
@julia-script
julia-script merged commit f8d3c1b into selfhost Oct 11, 2026
9 checks passed
julia-script pushed a commit that referenced this pull request Oct 11, 2026
#1450 removed the checkout path from package identities, so the Linux and macOS
emissions agree without staging sources at a fixed path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJak9tcQcwEZgNXjANPTiA
julia-script added a commit that referenced this pull request Oct 18, 2026
Name packages by their logical identity in module identities
julia-script added a commit that referenced this pull request Oct 18, 2026
#1450 removed the checkout path from package identities, so the Linux and macOS
emissions agree without staging sources at a fixed path.
@julia-script
julia-script deleted the selfhost-module-identity-root branch October 18, 2026 21:37
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