Skip to content

Initialize the package module before precompile workloads - #150

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codex/fix-workload-init-world-age
Sep 5, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codex/fix-workload-init-world-age

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Julia 1.12 cannot precompile RuntimeGeneratedFunctions with the supported PrecompileTools 1.2.1 dependency: init defines generated_callfunc inside the workload's scope, so the subsequent call sees a method newer than its world age. Initialize the module at top level before entering the workload. A subprocess regression test exercises this dependency combination without changing the surrounding test environment.

The regression starts at 73411b2. Its parent passes the same Julia 1.12.7 / PrecompileTools 1.2.1 smoke check. A freshly resolved environment selects PrecompileTools 1.3.4 and passes, but 1.2.1 remains within the declared compatibility range; the failure also reproduces in a fresh environment pinned to 1.2.1.

Verification

The new test/shared/precompiletools_v1_2.jl script was run with the same Julia 1.12.7 executable against a clean master checkout and the fixed checkout, with separate initially empty project environments:

/home/crackauc/.juliaup/bin/julia +1.12.7 --startup-file=no \
  --project=.validation/rgf-julia112-audit/permanent-before-env \
  RuntimeGeneratedFunctions-worldage-audit/test/shared/precompiletools_v1_2.jl \
  "$PWD/RuntimeGeneratedFunctions-worldage-before"

Before, exit 1:

ERROR: LoadError: MethodError: no method matching generated_callfunc(..., ::Int64)
The applicable method may be too new: running in world age 38842, while current world is 38850.

The identical script with permanent-fixed-env and RuntimeGeneratedFunctions-worldage-audit exits 0. The full official Core runner includes this test:

GROUP=Core /home/crackauc/.juliaup/bin/julia +1.10.11 --project=RuntimeGeneratedFunctions-worldage-audit -e 'using Pkg; Pkg.test()'
GROUP=Core /home/crackauc/.juliaup/bin/julia +1.12.7 --project=RuntimeGeneratedFunctions-worldage-audit -e 'using Pkg; Pkg.resolve(); Pkg.test()'

Both exit 0 and end with:

Test Summary:                | Pass  Total
PrecompileTools 1.2 workload |    1      1
Testing RuntimeGeneratedFunctions tests passed

Pkg.resolve() was necessary before the 1.12 run because the local 1.10 manifest omitted the Serialization stdlib entry; the initial 1.12 invocation stopped before executing tests. The resolved full run passed.

GROUP=QA /home/crackauc/.juliaup/bin/julia +1.12.7 --project=RuntimeGeneratedFunctions-worldage-audit -e 'using Pkg; Pkg.test()'
Test Summary: | Pass  Total   Time
QA            |   20     20  33.2s
Testing RuntimeGeneratedFunctions tests passed

Runic checks on all three changed Julia files, typos on all changed files, and git diff --check pass. No test is skipped or weakened. Pkg is added only as a test extra; its MIT license matches the host package. No new runtime dependency or public API is introduced.

Not verified: docs build (no documentation/docstring/public-API change), downstream packages, or Julia prerelease. The subprocess test resolves a small package environment and therefore requires registry/package availability, as the existing test setup does.

Ignore this draft until reviewed by @ChrisRackauckas.

🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; local transcript: /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-35-38-01a070ec-6fe3-7593-b7ea-92d4535aa542.jsonl).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-35-38-01a070ec-6fe3-7593-b7ea-92d4535aa542.jsonl
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Final verification: all 16 GitHub checks succeeded at commit cf9d4f9, including Core on Linux/macOS/Windows with LTS/current/prerelease Julia, QA, downgrade, documentation, formatting, and spelling. The branch has no commits behind the freshly fetched base and is merge-clean. It remains a draft for @ChrisRackauckas review.

Local failing-before/passing-after evidence, the bisected introducing commit, both local Core runs, and QA 20/20 are recorded in the PR body. No tests were skipped or weakened.

Links:

🤖 Codex CLI 0.153.4; model gpt-6-astra; local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-35-38-01a070ec-6fe3-7593-b7ea-92d4535aa542.jsonl.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 5, 2026 11:52
@ChrisRackauckas
ChrisRackauckas merged commit 630f710 into SciML:master Sep 5, 2026
16 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.

2 participants