Skip to content

Refactor xtask util helpers into modular modules#2095

Merged
oferchen merged 1 commit into
masterfrom
ensure-single-binary-for-oc-rsync
Nov 8, 2025
Merged

Refactor xtask util helpers into modular modules#2095
oferchen merged 1 commit into
masterfrom
ensure-single-binary-for-oc-rsync

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented Nov 8, 2025

Summary

  • split the oversized xtask util module into focused submodules for cargo helpers, command execution, git scanning, filesystem utilities, and limit parsing
  • re-export the helpers from a new util::mod and refresh the accompanying unit tests

Testing

  • cargo test -p xtask -q

Codex Task

@oferchen oferchen merged commit ce58ed2 into master Nov 8, 2025
@oferchen oferchen deleted the ensure-single-binary-for-oc-rsync branch November 8, 2025 23:18
oferchen added a commit that referenced this pull request May 7, 2026
Specifies a PID-style controller that resizes per-pipeline I/O buffer
windows in response to throughput feedback, layered on top of the
existing pressure-driven BufferPool grow/shrink logic. Covers
setpoint/PV/MV signals, sample cadence, anti-windup clamp, integration
points (disk-commit channel capacity, buffer pool slot size, multiplex
frame batching), Ziegler-Nichols tuning strategy, and three workload
presets gated behind --adaptive-buffers. Maps to follow-up tasks #2095
(implementation) and #2096 (convergence tests).
oferchen added a commit that referenced this pull request May 7, 2026
Specifies a PID-style controller that resizes per-pipeline I/O buffer
windows in response to throughput feedback, layered on top of the
existing pressure-driven BufferPool grow/shrink logic. Covers
setpoint/PV/MV signals, sample cadence, anti-windup clamp, integration
points (disk-commit channel capacity, buffer pool slot size, multiplex
frame batching), Ziegler-Nichols tuning strategy, and three workload
presets gated behind --adaptive-buffers. Maps to follow-up tasks #2095
(implementation) and #2096 (convergence tests).
oferchen added a commit that referenced this pull request May 7, 2026
Add a PID-style controller that adapts per-pipeline buffer window size
in response to observed throughput, per the design RFC at
docs/design/adaptive-buffer-controller.md.

The new module exposes AdaptiveBufferController and a builder-style
ControllerConfig with Ziegler-Nichols LAN-preset gains as defaults
(K_p=0.6, K_i=0.2, K_d=0.05). Internally a single std::sync::Mutex
guards the integrator, previous-error sample, and previous-sample
timestamp; the recommended buffer size is exposed via an AtomicUsize
for lock-free reads from the hot path. The dt is clamped to [1ms, 5s]
to defend against divide-by-zero on the derivative term and integral
windup on a stalled producer; the integrator is independently clamped
by the configured anti-windup window.

Tests cover proportional growth/shrink, integral steady-state-error
elimination, derivative damping on a step input, anti-windup clamping
under sustained error, both buffer-size clamps, reset semantics,
zero-dt safety, and a synthetic-plant convergence test against a
linear-saturating throughput model that confirms the default gains
settle within 10% of the setpoint inside 50 samples.

Integration into write-batch sizing, BufferPool capacity hints, and
multiplex frame batching is intentionally out of scope; that work is
tracked by the wiring follow-up under task #2096.

The RFC originally proposed crates/engine/src/pipeline/buffer_controller.rs,
but the engine crate has no pipeline module today; placing the file
alongside throughput.rs keeps the module tree flat and groups it with
the existing throughput EMA it will eventually consume. The deviation
is documented in the file's top doc comment.
oferchen added a commit that referenced this pull request May 7, 2026
Add a PID-style controller that adapts per-pipeline buffer window size
in response to observed throughput, per the design RFC at
docs/design/adaptive-buffer-controller.md.

The new module exposes AdaptiveBufferController and a builder-style
ControllerConfig with Ziegler-Nichols LAN-preset gains as defaults
(K_p=0.6, K_i=0.2, K_d=0.05). Internally a single std::sync::Mutex
guards the integrator, previous-error sample, and previous-sample
timestamp; the recommended buffer size is exposed via an AtomicUsize
for lock-free reads from the hot path. The dt is clamped to [1ms, 5s]
to defend against divide-by-zero on the derivative term and integral
windup on a stalled producer; the integrator is independently clamped
by the configured anti-windup window.

Tests cover proportional growth/shrink, integral steady-state-error
elimination, derivative damping on a step input, anti-windup clamping
under sustained error, both buffer-size clamps, reset semantics,
zero-dt safety, and a synthetic-plant convergence test against a
linear-saturating throughput model that confirms the default gains
settle within 10% of the setpoint inside 50 samples.

Integration into write-batch sizing, BufferPool capacity hints, and
multiplex frame batching is intentionally out of scope; that work is
tracked by the wiring follow-up under task #2096.

The RFC originally proposed crates/engine/src/pipeline/buffer_controller.rs,
but the engine crate has no pipeline module today; placing the file
alongside throughput.rs keeps the module tree flat and groups it with
the existing throughput EMA it will eventually consume. The deviation
is documented in the file's top doc comment.
oferchen added a commit that referenced this pull request May 7, 2026
Add a PID-style controller that adapts per-pipeline buffer window size
in response to observed throughput, per the design RFC at
docs/design/adaptive-buffer-controller.md.

The new module exposes AdaptiveBufferController and a builder-style
ControllerConfig with Ziegler-Nichols LAN-preset gains as defaults
(K_p=0.6, K_i=0.2, K_d=0.05). Internally a single std::sync::Mutex
guards the integrator, previous-error sample, and previous-sample
timestamp; the recommended buffer size is exposed via an AtomicUsize
for lock-free reads from the hot path. The dt is clamped to [1ms, 5s]
to defend against divide-by-zero on the derivative term and integral
windup on a stalled producer; the integrator is independently clamped
by the configured anti-windup window.

Tests cover proportional growth/shrink, integral steady-state-error
elimination, derivative damping on a step input, anti-windup clamping
under sustained error, both buffer-size clamps, reset semantics,
zero-dt safety, and a synthetic-plant convergence test against a
linear-saturating throughput model that confirms the default gains
settle within 10% of the setpoint inside 50 samples.

Integration into write-batch sizing, BufferPool capacity hints, and
multiplex frame batching is intentionally out of scope; that work is
tracked by the wiring follow-up under task #2096.

The RFC originally proposed crates/engine/src/pipeline/buffer_controller.rs,
but the engine crate has no pipeline module today; placing the file
alongside throughput.rs keeps the module tree flat and groups it with
the existing throughput EMA it will eventually consume. The deviation
is documented in the file's top doc comment.
oferchen added a commit that referenced this pull request May 18, 2026
Specifies a PID-style controller that resizes per-pipeline I/O buffer
windows in response to throughput feedback, layered on top of the
existing pressure-driven BufferPool grow/shrink logic. Covers
setpoint/PV/MV signals, sample cadence, anti-windup clamp, integration
points (disk-commit channel capacity, buffer pool slot size, multiplex
frame batching), Ziegler-Nichols tuning strategy, and three workload
presets gated behind --adaptive-buffers. Maps to follow-up tasks #2095
(implementation) and #2096 (convergence tests).
oferchen added a commit that referenced this pull request May 18, 2026
Add a PID-style controller that adapts per-pipeline buffer window size
in response to observed throughput, per the design RFC at
docs/design/adaptive-buffer-controller.md.

The new module exposes AdaptiveBufferController and a builder-style
ControllerConfig with Ziegler-Nichols LAN-preset gains as defaults
(K_p=0.6, K_i=0.2, K_d=0.05). Internally a single std::sync::Mutex
guards the integrator, previous-error sample, and previous-sample
timestamp; the recommended buffer size is exposed via an AtomicUsize
for lock-free reads from the hot path. The dt is clamped to [1ms, 5s]
to defend against divide-by-zero on the derivative term and integral
windup on a stalled producer; the integrator is independently clamped
by the configured anti-windup window.

Tests cover proportional growth/shrink, integral steady-state-error
elimination, derivative damping on a step input, anti-windup clamping
under sustained error, both buffer-size clamps, reset semantics,
zero-dt safety, and a synthetic-plant convergence test against a
linear-saturating throughput model that confirms the default gains
settle within 10% of the setpoint inside 50 samples.

Integration into write-batch sizing, BufferPool capacity hints, and
multiplex frame batching is intentionally out of scope; that work is
tracked by the wiring follow-up under task #2096.

The RFC originally proposed crates/engine/src/pipeline/buffer_controller.rs,
but the engine crate has no pipeline module today; placing the file
alongside throughput.rs keeps the module tree flat and groups it with
the existing throughput EMA it will eventually consume. The deviation
is documented in the file's top doc comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant