Skip to content

Report the build's worker allocations when asked - #9271

Merged
cknitt merged 1 commit into
masterfrom
worker-allocations-report
Nov 9, 2026
Merged

cknitt merged 1 commit into
masterfrom
worker-allocations-report

Conversation

@cknitt

@cknitt cknitt commented Nov 9, 2026

Copy link
Copy Markdown
Member

OCaml 5's allocation report at exit (OCAMLRUNPARAM=v=0x400) only counts the main domain, while the build compiles on worker domains: a clean build of tests/tests reported 3.2M words instead of about 252M.

With REWATCH_REPORT_WORKER_ALLOCATIONS set, the build also prints worker_allocated_words: <n> at exit. Each worker adds its own count (Gc.counters, minor + major − promoted, as the runtime counts) to a shared atomic counter when it stops. Without the variable nothing changes.

This is the base for the build benchmarks in the PR stacked on top, so that their base side reports the workers too. A new check in rewatch-ocaml/tests/run.sh builds a one-module project with the variable set and expects a positive count; the variable is documented in rewatch-ocaml/README.md next to REWATCH_COMPILER_DOMAINS.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm

OCaml's allocation report at exit (OCAMLRUNPARAM=v=0x400) counts only the
main domain, and the build compiles on worker domains: a clean build of
tests/tests reported 3.2M words instead of about 252M. With
REWATCH_REPORT_WORKER_ALLOCATIONS set, the build also prints
`worker_allocated_words: <n>`, for the compiler benchmarks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm
Signed-off-by: Christoph Knittel <ck@cca.io>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Changelog

No changelog entry.

Semantic Diff

1 commit · Full page

Report the build's worker allocations when asked

a5e4a65 · cknitt + Claude · Nov 09, 2026, 06:45 UTC

OCaml's allocation report at exit (OCAMLRUNPARAM=v=0x400) counts only the main domain, and the build compiles on worker domains: a clean build of tests/tests reported 3.2M words instead of about 252M. With REWATCH_REPORT_WORKER_ALLOCATIONS set, the build also prints worker_allocated_words: <n>, for the compiler benchmarks.

@cknitt
cknitt added this pull request to stack #9273 November 9, 2026 06:47
@cknitt cknitt added the changelog:skip No release notes needed label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ Compiler benchmarks

Allocated words

In total: 456,989,425 → 456,989,425 (±0.00%).

None of the 257 benchmarks changed by 0.1% or more.

Instructions

In total: 10,226,961,997 → 10,226,961,997 (±0.00%).

None of the 33 benchmarks changed by 0.1% or more.

Pull request a5e4a65 compared with base d47adb3 in this run.

@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@9271

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@9271

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@9271

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@9271

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@9271

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@9271

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@9271

commit: a5e4a65

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

@cknitt
cknitt requested a review from fhammerschmidt November 9, 2026 07:49
@cknitt
cknitt marked this pull request as ready for review November 9, 2026 07:49
@cknitt
cknitt merged commit ef5d33e into master Nov 9, 2026
27 of 28 checks passed
@cknitt
cknitt deleted the worker-allocations-report branch November 9, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:skip No release notes needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants