Files
Language-Server/docs/roadmap/10-scheduling-resources.md
T
faumaray da8003f6d4 Implement the VLS roadmap on the native VBS build
Native VBS and CMake builds of the server and every registered suite:
protocol and document sync, VBS/compdb providers, stock GCC diagnostics
(including in-process default profile preparation), the stock occurrence
observer and hover/definition, the bounded Scheduler, C++ module graph,
scan and artifact cache with real CMI production, the context-aware
symbol index with schema-2 snapshot migration, navigation and guarded
rename, reflection provenance with splice-origin extraction, index-backed
completion and signature help, live GCC worker control with a registered
DAP suite, and the Neovim and VS Code clients.

VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced
from the versioned patches and verified stepping reflection/template code
with projected values 17/34 and 41/82.
2026-12-05 14:06:50 +03:00

3.3 KiB

10 — Scheduling, cancellation and resource budgets

Status: A bounded scheduler library with a registered suite is implemented (pools, admission, coalescing, cancellation, watchdog, metrics). Integrating it into the analysis workers remains open. Requirements: R-011,R-021 Dependencies: 03,05,09; coordinates11,15 and18 without sharing mutable compiler state.

Ownership and boundaries

Proposed Astra for admission/revision logic; Sol for bounded queue/metrics helpers. NEW include/vls/scheduler/, src/scheduler/, tests/scheduler/; root owns shared priorities/limits. Future assignments must verify the then-current baseline and exact disjoint paths; these proposed scopes do not authorize work in another repository.

Contracts and data flow

Foreground requests outrank background indexing and artifact preparation. Every task has a revision, cancellation token, resource estimate and publication predicate. Debug admission is separate from semantic worker capacity. User-configurable budgets are validated, observable and never interpreted as permission to exhaust the host.

Implementation sequence

  1. Reuse verified Void Async/Time primitives for queues, cancellation and monotonic clocks; inspect actual backpressure/join behavior rather than infer it from class names.
  2. Coalesce superseded document work, reserve foreground capacity, avoid priority inversion on module dependencies and limit concurrent compiler states. Make queued cancellation cheap and running cancellation bounded.
  3. Track worker lifetime, memory, CPU, wall time and aggregate admission. Include deliberate pauses in memory accounting while excluding them from running watchdogs. Monitor and reap all owned descendants.
  4. Expose local metrics for cold/warm latency, queue delay, cancellation, cache misses and resource failures. Record the benchmark host and workload; do not turn measurements into unverified guarantees.

Failure behavior and constraints

Failed admission returns a useful resource/readiness status without blocking protocol handling. Watchdogs distinguish an intentional debug stop from a stuck running process. Failed/cancelled task results cannot satisfy cache/publication promises. Cleanup must handle a process-group leader exiting before descendants.

Acceptance scenarios

  1. Saturate background indexing and module builds while issuing foreground queries; measure p95 with and without an admitted paused debug session.
  2. Race edit/context cancellation with completion/publication and assert exactly one terminal result per request.
  3. Inject a zero-CPU stall, memory excess, lost child and disconnect; verify deadline enforcement, process reaping and bounded queue/memory growth.

Verification and integration

Proposed NEW CTest label: scheduler. Once implemented, register a nonzero suite and run:

dev cpp-gcc -c ctest --test-dir build/bootstrap -L scheduler --output-on-failure

This future command is not evidence that the label/tests exist now. Before dispatch, bind the fixtures above to actual targets and record prerequisites/side effects. Require fresh independent review of the implemented contract and affected integrations. Restore prior scheduling policy behind the same revision contract; drain/cancel obsolete queues. Keep resource-limit diagnostics/evidence instead of silently increasing limits after failures.