Global task registry assessment#118
Merged
FlareCoding merged 4 commits intopr/global-task-registryfrom Apr 1, 2026
Merged
Conversation
…gistry DS-tier tests (29 tests, no scheduler required): - init/count: empty registry starts at zero - insert: single, multiple, TID identity preservation, boundary TID values - remove: single, from-many, first/last, never-inserted safety, empty registry, remove-all, double-remove safety - reinsert: after remove, multiple cycles - snapshot_tids: empty, single, multiple, max capping, zero max, after remove - count tracking: incremental insert/removal, mixed operations - stress: 64-task insert/remove patterns, full cycle reinsert with new TIDs - consistency: snapshot agrees with count, reinit clears state - link integrity: pprev null after remove SCHED-tier integration tests (11 tests, real kernel tasks): - created task appears in global registry before enqueue - multiple created tasks all visible in registry - count increases on task creation - exited task eventually removed by reaper - task visible while alive, gone after exit+reap - batch exits all cleaned up - snapshot captures running/sleeping tasks - concurrent inserts from multiple CPUs via sub-task creation - rapid create/exit waves don't corrupt registry - count consistent with snapshot in quiescent state - no duplicate TIDs in snapshot All 500 tests pass on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
Cast intentionally-discarded [[nodiscard]] return values to (void): - dma.test.cpp: dma::alloc_pages in page_alloc_free_no_leak - poll_resource.test.cpp: ring_buffer_write in 4 test setup sites All 500 tests pass warning-free on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Save task pointers across the RUN_ELEVATED block so all created tasks can be enqueued after TID verification. Previously the pointers were lost after the block exited, leaking 4 task structs, stacks, and handles per test run and permanently polluting g_task_registry. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
…ation Some CI runners use slow machines and smp::init() may not be able to initialize all CPUs quickly enough. Sleep for 1 second to give the APs a chance to fully initialize before running unit tests. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
FlareCoding
added a commit
that referenced
this pull request
Apr 1, 2026
* test(sched): exhaustive unit and integration tests for global task registry DS-tier tests (29 tests, no scheduler required): - init/count: empty registry starts at zero - insert: single, multiple, TID identity preservation, boundary TID values - remove: single, from-many, first/last, never-inserted safety, empty registry, remove-all, double-remove safety - reinsert: after remove, multiple cycles - snapshot_tids: empty, single, multiple, max capping, zero max, after remove - count tracking: incremental insert/removal, mixed operations - stress: 64-task insert/remove patterns, full cycle reinsert with new TIDs - consistency: snapshot agrees with count, reinit clears state - link integrity: pprev null after remove SCHED-tier integration tests (11 tests, real kernel tasks): - created task appears in global registry before enqueue - multiple created tasks all visible in registry - count increases on task creation - exited task eventually removed by reaper - task visible while alive, gone after exit+reap - batch exits all cleaned up - snapshot captures running/sleeping tasks - concurrent inserts from multiple CPUs via sub-task creation - rapid create/exit waves don't corrupt registry - count consistent with snapshot in quiescent state - no duplicate TIDs in snapshot All 500 tests pass on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(tests): suppress nodiscard warnings in dma and poll_resource tests Cast intentionally-discarded [[nodiscard]] return values to (void): - dma.test.cpp: dma::alloc_pages in page_alloc_free_no_leak - poll_resource.test.cpp: ring_buffer_write in 4 test setup sites All 500 tests pass warning-free on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(tests): fix task leak in multiple_tasks_appear integration test Save task pointers across the RUN_ELEVATED block so all created tasks can be enqueued after TID verification. Previously the pointers were lost after the block exited, leaking 4 task structs, stacks, and handles per test run and permanently polluting g_task_registry. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(boot): add 1s delay before unit tests to let APs finish initialization Some CI runners use slow machines and smp::init() may not be able to initialize all CPUs quickly enough. Sleep for 1 second to give the APs a chance to fully initialize before running unit tests. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
FlareCoding
added a commit
that referenced
this pull request
Apr 1, 2026
… processes + stellux proc kill system call (#119) * feat(sched): implemented a skeleton for the global system-wide task registry (hashmap-based) * Global task registry assessment (#118) * test(sched): exhaustive unit and integration tests for global task registry DS-tier tests (29 tests, no scheduler required): - init/count: empty registry starts at zero - insert: single, multiple, TID identity preservation, boundary TID values - remove: single, from-many, first/last, never-inserted safety, empty registry, remove-all, double-remove safety - reinsert: after remove, multiple cycles - snapshot_tids: empty, single, multiple, max capping, zero max, after remove - count tracking: incremental insert/removal, mixed operations - stress: 64-task insert/remove patterns, full cycle reinsert with new TIDs - consistency: snapshot agrees with count, reinit clears state - link integrity: pprev null after remove SCHED-tier integration tests (11 tests, real kernel tasks): - created task appears in global registry before enqueue - multiple created tasks all visible in registry - count increases on task creation - exited task eventually removed by reaper - task visible while alive, gone after exit+reap - batch exits all cleaned up - snapshot captures running/sleeping tasks - concurrent inserts from multiple CPUs via sub-task creation - rapid create/exit waves don't corrupt registry - count consistent with snapshot in quiescent state - no duplicate TIDs in snapshot All 500 tests pass on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(tests): suppress nodiscard warnings in dma and poll_resource tests Cast intentionally-discarded [[nodiscard]] return values to (void): - dma.test.cpp: dma::alloc_pages in page_alloc_free_no_leak - poll_resource.test.cpp: ring_buffer_write in 4 test setup sites All 500 tests pass warning-free on both x86_64 and aarch64. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(tests): fix task leak in multiple_tasks_appear integration test Save task pointers across the RUN_ELEVATED block so all created tasks can be enqueued after TID verification. Previously the pointers were lost after the block exited, leaking 4 task structs, stacks, and handles per test run and permanently polluting g_task_registry. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(boot): add 1s delay before unit tests to let APs finish initialization Some CI runners use slow machines and smp::init() may not be able to initialize all CPUs quickly enough. Sleep for 1 second to give the APs a chance to fully initialize before running unit tests. Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com> * fix(poll/sched): fixed poll wake race that corrupted scheduler state * feat(proc): added kill-by-TID syscall with registry lookup and userland kill utility --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.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.

This pull request contains changes generated by a Cursor Cloud Agent