Repository navigation
GH-224: parent waits for the solver child in poll() (removes the 10 ms timing floor) - #226
Merged
Merged
Conversation
…stead of usleep(10000) The parent noticed the child's exit only at the next 10 ms tick, which quantized the wall time of fast runs into 10 ms buckets (LP_442 -engine=cc at ~23 or ~33 ms). The parent now sleeps in poll() on the bounds pipe and a SIGCHLD self-pipe, with the remaining -cpu-lim time (capped at 100 ms) as timeout. The deadline/SIGKILL path, the child code and all output are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heck, behaviour checks) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
guluchen
pushed a commit
that referenced
this pull request
Nov 4, 2026
…H-225 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #224 (hub #15; related #217 / #220).
Change
solve_in_child_forkinsrc/core/distqldpc.ccused to poll the solver child withusleep(10000). The parent saw the child's exit only at the next 10 ms tick, so the wall time of fast runs was quantized into 10 ms buckets.The parent now waits in
poll()on two file descriptors: the bounds pipe and a SIGCHLD self-pipe.fork(), so the solver child is untouched.waitpid(WNOHANG)that precedes everypoll().-cpu-limtime, capped at 100 ms as a safety net, or 1 ms if the self-pipe cannot be created.What stays the same:
The previous SIGCHLD disposition is restored afterwards. MODIFICATIONS.md is updated.
Tier 0
make test-cc: PASS on yfclab2 and on the Mac. The output equals main's except one timing-dependent counter, partE "levels abandoned": 37 on main vs 38 here. That test does not call the changed function.make test-cc-flags: 566/566 on both hosts.-cpu-lim=3TIMEOUT at 3.03 s with the same bounds (MaxSAT and CC);prlimit --asgives the same UNKNOWN;Tier 0 + Tier 1
Setup (yfclab2):
-no-card, CC default}.c d_ubline falls among the level lines; main's own repetitions vary the same way.Tiers 2-5: spot check only
By construction, Tiers 2-5 are unaffected: the solver child and the deadline path are unchanged, and the parent wakes less often than before. I did not run full Tiers 2-4 or the 6 h Tier 5. I spot-checked instead, interleaved with 3 seeds x 3 repetitions:
Evidence:
optimization/experiments/GH-224/(analysis.md,runner/,raw/).🤖 Generated with Claude Code