Repository navigation
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 |
|
Thanks for the rebase and for checking the reused project name in the headroom decision. I have read the October 3 results. The remaining verification of that updated head and landing decision are maintainer-side work; no further routine rebase is requested here. |
…ndex-cpu main moved 1,029 commits past this branch's base (96c3f41). Six same-spot conflicts, each resolved by keeping both sides: - src/mcp/mcp.c, index_run_supervised_path: the supervised worker args keep main's doc_candidates forwarding and add _cbm_background after it. - src/mcp/mcp.c, autoindex_thread: main's index_doc_candidates_apply() runs first, then the committed-index headroom decision. - src/pipeline/pipeline.c, run_extraction_phase: a frozen pipeline still forces one worker and records its route; every other pipeline takes cbm_pipeline_worker_count(). - src/pipeline/pipeline_incremental.c, run_extract_resolve: same shape, the frozen check first, then the pipeline-aware count. - src/pipeline/pipeline_incremental.c, closure_probe_surfaces: main's def_count < 0 abort is kept; the surface rows borrow probe_ctx with the pipeline set only around that one call, as before. probe_ctx never allows spilling, so the result lookup takes the same branch it took with a NULL context. - tests/test_mcp.c: both RUN_TEST blocks are kept. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Automatic jobs (session auto-index, watcher re-index) now carry _cbm_background, and the job registry decides whether a new request may join the job already running for its project by comparing the index arguments after normalising defaults. An explicit index_repository for the same root therefore stopped matching the automatic job and was refused with "another index operation for this project is active with different options" -- the refusal the repo_path separator fold (9846c3f) removed on Windows, now on every platform. _cbm_background chooses the worker count and never what is indexed, so drop it from the comparison the same way default-valued options are dropped. The explicit request joins the running job again. The new daemon_application test holds an auto-index job open with the fake worker, checks that its args carry the marker, and sends an explicit async index_repository for the same root. Without this change it is refused as an options conflict; with it the request joins (one worker start, one active job). The async fixture gains an optional stored config so the test can enable auto_index. Refs DeusData#1084 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, @mvanhorn, for sticking with this through four careful rounds, and for checking the reused project name in the headroom decision after #2344 -- that was exactly the right thing to verify. We have now finished the maintainer-side verification of 26eece5 and pushed two commits on top of your branch so it can land without another round trip for you:
What we checked on the result: the Thanks again for a well-tested change, and for your patience with a fast-moving |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thanks for the CPU-headroom work and for carrying it through the review rounds. I added two maintainer commits:
The agreed policy remains unchanged: the first automatic index keeps full-width throughput; background refreshes of an existing committed index leave CPU headroom, with explicit worker and single-thread overrides preserved. I am also correcting the description to reflect that final policy. Your original commits remain intact. Thanks again for the contribution. |
|
Thank you again for the CPU-headroom work. The October 21 update records the surface-budget correction and baseline refresh, with the agreed worker policy preserved. The next follow-up remains on our side; sorry for the delay, and I’ll follow up soon. |
…ndex-cpu main moved 12 merges past this branch's last base (72c3604). One conflict, in src/daemon/application.c: DeusData#2737 split application_background_index() into admit/wait helpers and gave it named result codes. Resolved by taking main's structure and keeping this branch's one change there: the automatic job's args carry _cbm_background after the policy call. The watcher path re-encodes mode/persistence/doc_candidates into the same document, so the marker survives the re-encode, and the job comparison still drops it. The net diff against main is unchanged: the same 13 files and the same added and removed lines as before the merge. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @mvanhorn, for the CPU-headroom work and for your patience while main keeps moving. Since the October 21 refresh, #2737 reshaped how the daemon admits watcher and background index jobs, and it landed on the same lines as your automatic-job marker in src/daemon/application.c, so the branch no longer merged cleanly. We pushed one merge commit on top of your branch (173e11a); your own commits are unchanged:
Fresh CI will run on the new head. If you push to this branch again, please pull first so this merge is not lost. Thanks again for a careful, well-tested change. |
A background refresh used performance cores minus one, which is a single worker on a host with two or fewer performance cores. One worker sends the indexer down the sequential route, which still builds a different graph than the parallel route (fewer Route and HANDLES edges, churned CALLS). Floor the background width at two whenever the foreground width is two or more; a host whose foreground width is one keeps one. CBM_WORKERS and CBM_INDEX_SINGLE_THREAD keep their precedence, and larger hosts keep their headroom unchanged. The pipeline and mcp worker-policy tests now expect the floored width, and a new pipeline test pins the width for one-core, two-core and larger host shapes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @mvanhorn, for the CPU-headroom work. The policy you built is the one we want, and because you routed every all-core site through one function, this follow-up is a single small change. While measuring the branch on real projects we found one interaction worth guarding, so we pushed one more commit on top of your branch; your own commits are unchanged.
If you push to this branch again, please pull first so this commit is not lost. Thanks again for a careful, well-tested change. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thanks again, @mvanhorn. Several other pull requests landed on main this evening, including changes in files this one also touches, so we merged current main into your branch once more (one signed-off merge commit, a9fceeb; your changes are untouched). That keeps the required checks honest against today's tree; we will merge once they are green. Please pull before pushing again. |
…t test Main added the manifest-skip-locked test (9f57edf) with the old cbm_pipeline_build_semantic_manifest signature. This branch gives the function a leading pipeline parameter, so the tree merged from main failed to compile. Pass NULL like the branch manifest-fail-closed test already does. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @mvanhorn, and sorry for one more push on your branch. When we merged current main in this evening, a test that main had just added (manifest-skip-locked, from 9f57edf) still called cbm_pipeline_build_semantic_manifest with the old signature, while your branch gives that function a leading pipeline parameter. The files merged without a textual conflict, but the combined tree did not compile. We pushed one line (4316e93) that passes NULL as the first argument, exactly like your own manifest-fail-closed test does. Your changes are untouched. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @mvanhorn. CI went green on this branch, but this evening's merges on main touched files this pull request also changes, so that green no longer covered today's main. We merged current main into the branch once more (one merge commit, acd0b5b; your changes are untouched) and will merge once the fresh checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @mvanhorn, for your patience with this one. Two pull requests merged into main a few minutes ago (#2754 and #2090), and they touch src/pipeline/pipeline.h, which this pull request also changes. So we merged current main into your branch once more (one merge commit, 79d02a6; it merged cleanly and your own change is untouched), checked that the merged files still compile, and started a fresh CI run. We will merge as soon as the required checks are green. Please pull before pushing again so the merge commit is kept. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @mvanhorn. A pull request that merged into main a few minutes ago (#2769) changes src/pipeline/lsp_surface.c and pipeline.c, which this pull request also changes, so the CI run in progress here could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, ed95814; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @mvanhorn. A pull request that merged into main a few minutes ago (#2600) changes src/mcp/mcp.c, which this pull request also changes, so the CI run in progress here could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, 7854e1c; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @mvanhorn. A pull request that merged into main tonight (#2601) changes src/pipeline/pipeline_incremental.c, which this pull request also changes, so CI on this branch could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, 88375be; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Automatic refreshes of an existing committed index should leave CPU headroom while preserving throughput for a first automatic index and for explicit/manual indexing. This change carries an internal background-execution marker through daemon coordination and worker serialization, then applies the existing background worker policy in the pipeline. It adds no public MCP option or user-facing configuration key.
The final policy preserves
CBM_WORKERSprecedence and single-thread crash recovery. Surface construction also respects the total worker budget, including the calling thread, rather than allowing one extra active callback. Existing non-Git auto-index limits, watcher deduplication, and subprocess RSS isolation remain in place.Fixes #1084
Validation: