Repository navigation
mutate: each bounded process watched by its own ticker - #21
Merged
Merged
Conversation
… parents walked once The one poller every bounded run shared never ended, scanned /proc when nothing ran, and needed a registry, a mutex and a copy of the limit to outlive the tests that set it. Each run now has a watcher that starts with the process and ends with its Wait; a scan is a couple of milliseconds, a fifth of a core at -j 10. The tree is walked from a snapshot /proc gives a process at a time: a pid reused while it is read can close a loop of parents, which is now walked once rather than for ever. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Follows #20, from a KISS/YAGNI review of what the repositories took at 7fefec3.
What changes
/procevery 100 ms even with nothing running, and needed a registry (map, mutex,sync.Once), awatchtype, and a copy of the limit in each watch, which existed only because the goroutine outlived the tests that changememLimit. Nowboundedstarts a goroutine that ends whenWaitreturns: it is born withStartand dies withWait, with no package state. The cost is one/procscan per process per tick: about 2 ms, a fifth of one core at-j 10, beside the ten test processes it measures./procis read one process at a time, so a pid reused mid-scan can close a loop A→B→A, which the walk followed for ever while holding the lock. The walk is nowtreeOf, a pure function with aseenset, and a test with a loop of parents holds it.The tests from #20 (the mutant stopped, the package as it is let be under the same bound, no test binary left running) are unchanged and pass.
task test(race),task lintandtask mutate(7 refused, 0 survived) green locally.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.