Skip to content

comptime: parse is a With body, tool mode may ask its pid and claim jobserver slots (#2460) - #2462

Merged
ehartford merged 1 commit into
mainfrom
sdk-evaluator-fixes
Oct 19, 2026
Merged

ehartford merged 1 commit into
mainfrom
sdk-evaluator-fixes

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Second round of the SDK rebuild (run 39171886271): linux-aarch64 and darwin went green; both Windows jobs failed one step deeper in build/par.w:

'with_getpid' has no With body to evaluate at compile time; reached through run_sdk_windows_libc_action -> sdk_compile_all -> par_run -> par_slot_acquire -> pid

Fixes, each at its owner:

  • lib/std/string.w: string_to_int is a With digit loop (string_to_int's exact rule), not the with_parse_i64_ref extern — parsing is pure, so parse is now comptime-evaluable everywhere. test/behavior/behav_2460_comptime_parse.w pins it (shown failing before, passing after with stage1).
  • src/ComptimeEval.w: tool mode's allowed runtime calls gain with_getpid, with_fs_symlink, with_fs_remove_file. In tool mode the evaluator is the build process, so its pid is the slot owner a native runner would name; the slot symlink/remove pair is driver state outside any action's declared write scope by design.
  • build/par.w: par_lane_critical reads the critical file through the ToolFs capability (read_text_opt) instead of std.fs read_file's pointer out-param extern; the par_slots_from digit loop from SDK rebuild: the four host failures of run 39152082294, each at its line (#2305) #2461 is deleted now that parse itself is evaluable.

Evidence: :dev green, stage1 check src/main.w ok, ceremony census diff ok, nearby tests green (behav_2460, behav_914, behav_2142, test/comptime_diff), :gate rc=0. Battery result posted before ready. Integration proof for the tool-mode whitelist is the SDK re-dispatch after merge (the windows jobs' sdk-windows-libc).

Closes the par.w half of #2460; the general question (which std helpers are evaluator-safe) stays open there.

… claim jobserver slots (#2460)

The SDK rebuild's second round (run 39171886271): linux-aarch64 went green, and both Windows jobs failed one step deeper in build/par.w - par_slot_acquire -> pid -> extern with_getpid, which the evaluator refused. Three fixes at their owners: std.string's string_to_int is a With digit loop instead of the with_parse_i64_ref extern, so parse is comptime-evaluable everywhere (behav_2460_comptime_parse, shown failing before); eval_allowed_runtime_call answers with_getpid, with_fs_symlink and with_fs_remove_file in tool mode, where the evaluator is the build process and the jobserver slot pair is driver state outside any action's write scope; par_lane_critical reads the critical file through the ToolFs capability instead of std.fs's pointer out-param extern. The par_slots_from digit loop from #2461 is deleted - parse is the one spelling again.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery green on 87dd2fd: battery rc=0 wall=315s, GREEN/BATTERY_DONE in out/battery/status.txt. New test behav_2460_comptime_parse shown failing before the fix and passing after (stage1). Marking ready and merging.

@ehartford
ehartford marked this pull request as ready for review October 19, 2026 00:25
@ehartford
ehartford merged commit f081060 into main Oct 19, 2026
@ehartford
ehartford deleted the sdk-evaluator-fixes branch October 19, 2026 00:25
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