BG Build Governor
.NET / Windows

Build Governor, builds that slow down instead of crashing.

Lightweight governor that sits between your build system and the compiler. Adaptive concurrency based on commit charge — zero config, automatic throttling, actionable OOM diagnostics.

Setup

.\scripts\enable-autostart.ps1

Build

cmake --build . --parallel 16

Status

gov status

Why Build Governor?

Parallel builds shouldn’t be a gamble.

Zero Config

Wrappers auto-start the governor on first build. No daemon setup, no config files, no admin required.

Adaptive Throttling

Monitors commit charge in real time. Builds slow down gracefully instead of freezing your machine.

Actionable Diagnostics

Classifies failures as OOM, paging death, or normal errors. Recommends the right -j value.

Fail-Safe

If the governor is down, wrappers run tools ungoverned. Your build never depends on the governor being healthy.

Token Cost Model

Assigns costs by operation type: normal compile (1), template-heavy (2–4), LTCG link (8–12). Matches real memory profiles.

NuGet Libraries

Gov.Protocol and Gov.Common let you build custom tooling on top of the governor’s memory metrics and OOM classifier.

Quick Start

Automatic (recommended)

# One-time setup (no admin required)
cd build-governor
.\scripts\enable-autostart.ps1

# That's it! All builds are now protected
cmake --build . --parallel 16
msbuild /m:16
ninja -j 8

NuGet libraries





Throttle Levels

Adaptive response based on system commit charge.

Commit Ratio
Level
Behavior
< 80%
Normal
Grant tokens immediately
80–88%
Caution
Slower grants, 200 ms delay
88–92%
SoftStop
Significant delays, 500 ms
> 92%
HardStop
Refuse new tokens

Token Cost Model

Costs reflect real-world memory profiles.

Action
Tokens
Notes
Normal compile
1
Baseline
Heavy compile (Boost/gRPC)
2–4
Template-heavy
Compile with /GL
+3
LTCG codegen
Link
4
Base link cost
Link with /LTCG
8–12
Full LTCG

NuGet Packages

Package
Purpose
Gov.Protocol
Shared message DTOs for client–service communication over named pipes
Gov.Common
Windows memory metrics, OOM classification, auto-start client

CLI Commands

Command
What It Does
gov run -- <build cmd>
Run a governed build
gov status
Check governor status and memory metrics
gov run --no-start -- <cmd>
Run without auto-starting governor