Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Welcome, and thank you for the PR 👋 — one quick, mechanical thing before review, so you are not left guessing at the red.
The fix is to amend the commit with a sign-off and force-push your branch:
If you end up with more than one commit, Two things that will save you time when the rest of CI reports:
I will review the change itself properly once it is signed off — background-indexing CPU headroom is a good thing to be looking at, and +209/-12 over 8 files is a reviewable size. |
|
Attributed your reds so you are not chasing nine separate things — there are really only two, and one of them is a genuinely interesting test-design point. 1.
|
This comment has been minimized.
This comment has been minimized.
Maintainer notice: please disregard comments from @adfjadfj16-a11y on this thread@adfjadfj16-a11y is not a maintainer of this project and does not speak for it. That account has posted replies on 17 threads here written in the project's voice — promising merges, announcing that a case has been "escalated to the development team", asking to close issues, and in some threads replying as though it were the author of someone else's pull request. None of those were maintainer decisions, and none of them carried any weight. @DeusData is the only account that gives a maintainer response on this repository. If a comment about the fate of your issue or pull request did not come from @DeusData, it is not a decision, however official it reads. If you were waiting on something because of one of those comments — a promised merge, a review "immediately", a request to close your ticket — I am sorry. That was noise you had no way to identify as noise, and it should not have been on your thread. Your issue or PR is judged on its own merits, and I will answer it here myself. Nothing in this notice reflects on your contribution. Thank you for your patience, and thank you for the work. |
c846ed7 to
84fffef
Compare
DeusData
left a comment
There was a problem hiding this comment.
The attribution I owed you on 3 September, with apologies that it took this long. Every red on your run 34091819685 is now accounted for, and none of them is a mystery:
| job | what failed | whose |
|---|---|---|
test-diag, test-lsan-macos, test-unix 2/3 (x64 + arm64) |
suites fully green (7643 passed, 0 failed etc.), then LSan: 360 bytes in 9 allocations, stack autoindex_thread → cbm_pipeline_run → … → cbm_kind_in_set |
ours, stale base: the in-process auto-index thread never freed its extraction bitset cache; fixed on main by e45d7051 (#2116) after your merge base. Your new test is simply the second thing to exercise that thread. Disappears on rebase. |
test-tsan (macos-14, ubuntu x64, ubuntu arm64) |
mcp_auto_index_in_process_uses_background_worker_policy: selected_workers == 2, expected cbm_default_worker_count(false) == 4 (3 vs 4 on the 4-core runners) |
the PR's own test, assertion order: the test unsets CBM_WORKERS for the run, then restores the environment, and only then computes the expected value — which now sees the lane's CBM_WORKERS=4. Deterministic; here it fails the other way under CBM_WORKERS=1 (5, expected 1). |
No infrastructure flake among them, and the Windows guard was green on your run.
On the change itself, which I read in full on your head and built and ran locally: I like it. Routing every automatic index — in-process auto-index, the supervised worker, the daemon's session auto-index and the watcher re-index — onto the existing "leave headroom" policy through one flag, while an explicit index_repository keeps every core and CBM_WORKERS / CBM_INDEX_SINGLE_THREAD keep their precedence, is the smallest shape that does the job, and reusing the incremental policy rather than inventing a second one is the right instinct. It changes only the worker count fed to the scheduler, never merge order or a work cap, so the graph is unaffected; no delay, no raw fopen, no new allocation site. pipeline 266/0 and daemon_application 52/0 pass here, and with the production hunks neutered your preserves_overrides and the two daemon_application assertions go red, so the tests bind.
Four things before it can merge:
- Rebase onto
main. The four LSan reds vanish with it. The conflicts are all same-anchor insertion drift against the opt-in resource-policy work (21ae0215) and #713's tests: keep both sides inpipeline.h/pipeline.cand the two test files, and in the three args builders (application_auto_index_args,application_background_index,index_run_supervised_path) chain your_backgroundbool aftermain's policy call inside its guarded form. - Fix the assertion order in
mcp_auto_index_in_process_uses_background_worker_policy: captureint expected = cbm_default_worker_count(false);inside the window where the variables are unset, beforemcp_test_restore_env, and assert against that. Yourpipeline_background_worker_policy_preserves_overridesalready does it this way. pipeline_background_policy_preserves_index_resultsis inert.setup_test_repo()writes about three files, belowMIN_FILES_FOR_PARALLEL(50), so foreground and background both take the sequential path and the test stays green with the policy removed. Either give it a fixture past 50 files so it really compares an all-core index against a headroom index, or drop it and name the existing determinism test that covers the property.- The description overstates the coverage. Two all-core sites are still unrouted on a background run: the LSP-surface pass (
lsp_surface.c,cbm_parallel_forwith auto-detected workers) and incremental hashing (pipeline_incremental.c,hash_workers = cbm_default_worker_count(true)). Both have the pipeline in reach; route them throughcbm_pipeline_worker_counttoo, or narrow the description to what is covered. Small naming nit while you are there:_cbm_backgroundmatches the existing_cbm_index_policyconvention for hidden keys.
One product question I want to be explicit about rather than bury: with this, a user who connects with auto_index=true gets their first graph built on perf_cores-1 workers, so the first index takes a little longer in exchange for a responsive machine. I think that is the right trade and it is the thesis of the PR, but it is a visible change on first connect, and I will confirm it on our side before merging. Thank you for the careful set of tests and for waiting out nineteen days of silence you did nothing to earn.
84fffef to
7498e2b
Compare
|
Thank you for the attribution, and for taking the time to sort every red into whose it was. That saved me chasing the LSan leak. All four are done, rebased onto
One thing worth your eye in 4: On the product question: I agree that is the right trade, and I think it is worth saying in the release note rather than only here, since a slower first index on 666 passed, 4 skipped locally across the pipeline, mcp and daemon_application suites. |
DeusData
left a comment
There was a problem hiding this comment.
Thank you for turning all four around so quickly. The assertion order, the 64-file fixture that finally makes the invariance test compare two different worker counts, and routing the two remaining all-core sites are all right, and I verified them on the merge result with today's main (e783f73d): build clean; pipeline 289, daemon_application 56 and mcp 321 passed; memory-core linter unchanged.
Your question about closure_probe_surfaces first, because the answer is that you were right and the hunk should stay. The surface builder reads the context for exactly one thing, the worker count, and the only function it forwards the context to, cbm_pipeline_result_acquire, reads nothing but ctx->spill, which probe_ctx never sets. So that call takes the same branch it took when you passed NULL, and no file error can be recorded through it, twice or at all. What would break the property is leaving probe_ctx.pipeline set for the struct's whole lifetime, because then cbm_parallel_extract above it would see a pipeline. Your set-and-clear around the one call is exactly the shape that avoids that.
Two things before it merges, and the first is the product question you and I discussed:
- A project's first index runs at full width. We have decided the trade the other way round for the one case where it matters most. When someone connects and the project has no index yet, they are waiting for a graph that does not exist, and a first build one worker short is the slowest possible moment to make them wait. Once an index exists, a refresh really is background work, and leaving a core free is right. So
_cbm_backgroundshould take effect only when a committed index for the project already exists; a project's very first index keeps every core even when it was started automatically, and watcher re-indexes and auto-indexes of an already-indexed project keep the headroom. The flag is honoured in two places today,handle_index_repository(reads_cbm_background, thencbm_pipeline_set_background) and the in-processautoindex_thread(sets it directly), so the check belongs there, or in one shared helper both call, as long as the two paths agree. For tests, a pair makes the rule visible: the in-process auto-index of a fresh project asserts full width, and the same auto-index of a project that is already indexed asserts headroom. - The lint job.
src/pipeline/pipeline.c:207still has two spaces before the trailing comment on the newbool background;field where the block wants one. I reproduced it with our own Homebrew clang-format 22.1.8, so it is a genuine violation and not the standaloneclang-format-20drift we have been caught by before;clang-format -ion that file fixes it and touches nothing else.
Everything else stands as reviewed. After those two, this merges. If the Windows guard job goes red on your next run, that is the daemon endpoint cold-start race on our side (#2275), not your change.
|
Thanks, that trade makes sense. Both are done in 7a307ab.
|
|
Thank you, @mvanhorn, for four quick and careful rounds on this. The first index keeping full width is exactly what was decided, and the review of 7a307ab is clean. One last step before it can merge:
Keeping both sides resolves the text in each case. One thing is worth a look while you're there: #2344 changed how Could you rebase onto current |
Fixes DeusData#1084 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Addresses the four blockers from review: - Capture the expected worker count while CBM_WORKERS is still unset in mcp_auto_index_in_process_uses_background_worker_policy, so the assertion no longer reads the lane override restored just before it. - Give pipeline_background_policy_preserves_index_results a fixture past MIN_FILES_FOR_PARALLEL and drop any inherited CBM_WORKERS / CBM_INDEX_SINGLE_THREAD pin, so it really compares an all-core index against a headroom index instead of two sequential runs. - Route the two remaining all-core sites through cbm_pipeline_worker_count: the LSP surface pass and incremental manifest hashing. The pipeline is plumbed into cbm_pipeline_build_semantic_manifest for that. - Rename the hidden key _background to _cbm_background, matching the existing _cbm_index_policy convention, across every producer and consumer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Du315CaKLufAYPEdEwcocq Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
7a307ab to
26eece5
Compare
|
Rebased onto current On the unnamed re-index: I ran |
What does this PR do?
Carry an internal background-execution marker on the index requests created by both session auto-index and watcher re-index paths, preserving it through daemon coordination and supervised-worker serialization. When
handle_index_repositorybuilds the pipeline, translate that marker into pipeline execution context rather than changing the public MCP tool schema or adding a user-facing configuration key. Make full and incremental pipeline worker-count selection consult that context and use the existing background/incremental default that leaves CPU headroom; retain the currentCBM_WORKERSprecedence, single-thread crash-recovery behavior, and all-core default for explicit/manual indexing.Enabling
auto_indexhas repeatedly caused high CPU usage and severe Windows UI stutter, including a fresh confirmation on v0.10.8. Main already contains the maintainer-identified non-Gitauto_index_limitguard, dirty-state watcher deduplication, and subprocess RSS isolation, so reimplementing those fixes would be a no-op. The remaining production path still treats automatic first indexing like a foreground full index: the pipeline selects theinitial=trueworker policy, whose documented behavior is to use every detected core because “the user is waiting.” Automatic session and watcher jobs run in the background, so they should instead use the repository's existing headroom-preserving worker policy while explicit indexing retains its current throughput.Fixes #1084
Checklist
git commit -s) — required, CI rejectsNot run: no test command resolved in this workspace, so nothing was executed to pass.
unsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)Not run: no test command resolved in this workspace, so nothing was executed to pass.
make -f Makefile.cbm lint-ci)Not run: no test command resolved in this workspace, so nothing was executed to pass.