Skip to content

Unify module layer resolution - #68

Merged
DanielThomas merged 1 commit into
mainfrom
fix/unify-module-layer-resolution
Sep 19, 2026
Merged

DanielThomas merged 1 commit into
mainfrom
fix/unify-module-layer-resolution

Conversation

@DanielThomas

Copy link
Copy Markdown
Member

Summary

  • centralize module precedence, graph traversal, and one-loader layer construction in Configurations.Resolution
  • route source/test layers, scoped tool layers, tool-provider layers, service-bound discovery layers, and runtime-access expansion through the same implementation
  • preserve explicit before-parent vs after-parent semantics instead of reselecting same-named modules from unordered reachable-module sets
  • add regressions for source modules shadowing linked runtime modules and parent modules shadowing after-parent module-path replacements

Motivation

A linked self-hosting runtime could expose both jrt: and source versions of the same module in the reachable graph. Callers independently reduced that graph by module name, so selection depended on set iteration order. This changed test cache identities between runs. Other tool resolution code also bypassed the resolved graph by looking modules up again on the module path.

The resolution object now owns:

  • before-parent and after-parent precedence
  • effective lookup by module name
  • deterministic reachable-module traversal
  • path-module selection
  • optional traversal policies for runtime access
  • module-layer definition

All production Configuration.resolve / resolveAndBind, ResolvedModule.reads(), and ModuleLayer.defineModulesWithOneLoader use in the application module now lives in Configurations.

Validation

  • ja run -m com.netflix.tools.ja test --all — 385/385 successful
  • cold patched self-host test run — 385/385 successful
  • immediate second run — 383 cached, 2 executed (~0.28s)

@DanielThomas
DanielThomas merged commit 84a65e3 into main Sep 19, 2026
7 checks passed
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