cgroup opens an explicitly chosen v2 hierarchy root or delegated subtree. It provides owned group handles, atomic command placement, process membership, subtree freezing and termination, CPU bandwidth and weight, memory and swap controls, task limits and observations, per-device I/O controls, cpuset placement, and HugeTLB, RDMA, miscellaneous resource, and device-memory controls. It targets Linux 7.0+.
Workload managers can start workers inside their resource limits, pin them to selected CPUs or memory nodes, and cap their block-device bandwidth within an explicitly delegated cgroup v2 subtree. systemd resource control uses cgroups to organize and constrain services.
group, err := cgroup.Open("/sys/fs/cgroup")
if err != nil {
return err
}
defer group.Close()
controllers, err := group.Controllers()
if err != nil {
return err
}
fmt.Println(controllers)
Open verifies the cgroup v2 filesystem. Its initial path uses ordinary symlink resolution. Child Open, New, and Remove take exactly one component and reject empty names, ., .., slashes, and NULs; child opens reject symlinks. A handle anchors the acquired directory even if its original path changes. It is not a security boundary against a privileged actor replacing mounts or changing the hierarchy concurrently.
Close releases only the directory reference. Remove(name) removes an empty child with Linux rmdir semantics; it never recursively deletes, kills processes, or moves them. Closing a parent leaves independent child handles and watchers open. Creation returns no owner on error and cleans up a newly created child if opening it fails; a cleanup failure is joined with the primary error. Coordinate lifecycle operations with other hierarchy owners rather than assuming exclusive access from permissions alone.
The delegator must grant the directory and the appropriate cgroup.procs, cgroup.threads, and cgroup.subtree_control permissions, and enable the desired controllers in its own subtree control. A systemd-managed path or UID 0 alone is insufficient evidence of delegation. The library never changes ancestors, creates a mount, grants permissions, or moves itself automatically. See the upstream delegation contract.
For a caller-owned empty domain group, explicitly enable controllers before creating leaf workloads:
if err := group.SetControllers([]cgroup.Controller{cgroup.CPU, cgroup.Memory, cgroup.PIDs}, nil); err != nil {
return err
}
worker, err := group.New("worker")
if err != nil {
return err
}
defer worker.Close()
if err := worker.SetCPUMax(cgroup.CPUBandwidth{
Quota: 50 * time.Millisecond,
Period: 100 * time.Millisecond,
}); err != nil {
return err
}
if err := worker.SetMemoryMax(cgroup.Limit(256 << 20)); err != nil {
return err
}
if err := worker.SetPIDsMax(64); err != nil {
return err
}
The caller still removes worker after all its processes and descendants have gone. An error after some settings were applied does not roll them back. SetControllers(enable, disable) sends one command, so Linux accepts or rejects its changes together; unmentioned controllers remain unchanged. Names not supported for mutation and duplicate/overlapping requests match os.ErrInvalid. Inspection retains unknown controller names. Enabling domain controllers in a populated non-root group violates Linux’s no-internal-process constraint, and disabling a controller needed by descendants fails. Read Controllers for availability and SubtreeControl for what is enabled for immediate children; neither establishes write permission. See controller configuration.
Once the workload leaf and its limits are ready, configure a fresh exec.Cmd
and use the group to start it. The command retains ordinary Go I/O, context
cancellation after startup, and waiting.
cmd := exec.CommandContext(ctx, "/usr/local/bin/worker", "--foreground")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := worker.Start(cmd); err != nil {
return err
}
return cmd.Wait()
Start borrows the open group for the duration of startup. Linux creates the
child in that group and checks the parent’s delegation permissions, the
hierarchy topology, and task limits at clone time. A missing or blocked
clone3 surfaces as the ordinary command-start error. Later migration or
hierarchy changes can affect the workload, and closing the group leaves a
successfully started command running. Starting in a frozen group can block
until another operation thaws it. The command context does not interrupt that
startup wait.
Configure credentials and namespaces on cmd.SysProcAttr as usual. Give
Start exclusive access to the command until it returns. An existing
clone-into-cgroup request matches os.ErrInvalid. Validation and closed-group
errors leave the command and any prepared pipes available to the caller.
Once startup reaches cmd.Start, ordinary Go cleanup and command-reuse rules
apply. Caller-supplied files remain caller-owned.
AddProcess(pid) migrates a positive numeric PID’s whole thread group through
cgroup.procs. Linux also requires write access to the common ancestor of
source and destination. PID exit and reuse can race with migration. Membership
snapshots are unordered, can contain duplicates, and can include zero for
processes invisible in the reader’s PID namespace. Existing memory charges stay
with their original group. Linux process organization.
| Surface | Meaning |
|---|---|
CPUWeight / SetCPUWeight |
cpu.weight, 1–10000; Linux’s default is 100. |
CPUMax / SetCPUMax |
Complete cpu.max record; quota and period use time.Duration with exact microsecond precision. UnlimitedQuota is the explicit unlimited quota; period must be 1 ms–1 s. CPU controls apply to fair-class tasks. |
CPUMaxBurst / SetCPUMaxBurst |
cpu.max.burst allowance in whole microseconds, represented as a duration. Zero disables bursting. Linux checks the allowance against the current quota. |
CPUWeightNice / SetCPUWeightNice |
cpu.weight.nice, a coarser view of group weight on the -20 to 19 nice scale. |
CPUIdle / SetCPUIdle |
cpu.idle selects ordinary or lowest-priority scheduling relative to peer groups. Mode transitions affect the group’s weight. Inspect CPUIdle to distinguish idle mode from an ordinary low weight. |
CPUUClampMin / SetCPUUClampMin, CPUUClampMax / SetCPUUClampMax |
Requested utilization clamps in hundredths of one percent. Ancestors and the effective maximum constrain the effective minimum. Group utilization clamping requires kernel support. |
CPUStat |
cpu.stat, preserving unsigned keys and Linux units such as usage_usec. |
CPUStatLocal |
cpu.stat.local, with local throttled_usec on Linux 7.0 when available. An empty file returns a nil map. Both stat methods preserve unknown counters and leave missing keys absent. |
PIDsMax / SetPIDsMax |
pids.max, counting tasks/threads. Zero prevents new task creation; migration can exceed the limit. |
PIDsCurrent / PIDsPeak |
pids.current task count and pids.peak lifetime watermark, including descendants. The peak is approximate under concurrent task changes. |
PIDsEvents / PIDsEventsLocal |
pids.events and pids.events.local. By default max attributes task creation failures to the group whose limit caused the refusal. The hierarchical file also includes hits on descendant limits. |
Limit is a finite nonnegative int64 byte/task count or Max, encoded as max. Zero is a finite value. Values below Max are invalid. Ancestor limits continue to apply. Every method call takes a separate observation or applies one control. See the CPU controller specification.
Use PIDsPeak to size a workload’s task limit. To diagnose a refused fork or clone, check the relevant ancestor limits and counters. With the pids_localevents mount option, both event files count attempts that originated in the current group and failed due to its own or an ancestor’s limit. Each call reads its file independently. Event maps retain unknown counters and leave unavailable keys absent. When the kernel omits a control file, the read error matches os.ErrNotExist. Linux 7.0 PIDs controller, event accounting implementation.
Limit and CPUBandwidth implement text marshaling/unmarshaling for persisted native records. ParseCounters and ParseEvents decode captured snapshots without opening a hierarchy; malformed input returns no partial result, and failed text unmarshaling leaves its receiver unchanged. Unknown unsigned counter/event fields are preserved. Decimal counts outside the supported type’s range are rejected.
For a latency-sensitive workload, set the CPU quota before setting a nonzero burst allowance. When reducing the quota, lower or clear an incompatible burst first. Each call applies independently. Utilization clamps describe scheduler capacity, while quota and burst describe CPU time. For example, group.SetCPUUClampMin(1250) requests 12.50% capacity. CPUUtilizationMax represents the kernel’s max token. Linux can also report max for a numeric request that rounds to full capacity. Linux 7.0 CPU controls.
Enable cgroup.Memory for the workload’s parent. All configuration values in the following table are bytes. Linux rounds finite requests down to whole pages. With Max, a limit is unlimited at that level and a protection boundary covers all usage subject to effective hierarchical protection. Linux 7.0 memory controller.
| Read / write | Effect |
|---|---|
MemoryMin / SetMemoryMin |
Hard reclaim protection. Effective protection depends on the reclaim target, ancestor settings, and competing usage. Zero clears the protection. |
MemoryLow / SetMemoryLow |
Best-effort reclaim protection. Under pressure, Linux can reclaim from below this boundary when it runs out of unprotected reclaimable memory. Zero clears the protection. |
MemoryHigh / SetMemoryHigh |
Memory threshold for reclaim and throttling. |
MemoryMax / SetMemoryMax |
Hard memory limit. The cgroup OOM killer can intervene when reclaim cannot make room for a charge. |
MemorySwapHigh / SetMemorySwapHigh |
Swap threshold for throttling further allocations. This boundary gives a workload manager an opportunity to intervene. |
MemorySwapMax / SetMemorySwapMax |
Hard swap limit. Zero prevents new swap charges. If a reduction puts current usage above the limit, Linux releases existing entries gradually. |
SetMemoryHigh and SetMemoryMax use O_NONBLOCK to defer reclaim and OOM work to the charging workload. Usage can remain above a reduced boundary until new charges occur. Each setter writes one file, so a series of changes can apply partially.
MemoryCurrent and MemorySwapCurrent report hierarchical usage. MemoryPeak and MemorySwapPeak report the hierarchy’s lifetime high-water marks. Linux peak resets apply to the file descriptor performing the reset. Group snapshots use a fresh open for each read.
MemoryStat breaks memory usage down by type and reports kernel activity counters. Amounts such as anon and file are bytes, while entries such as pgfault count events. MemoryEventsLocal counts only events originating in the group. MemoryEvents and MemorySwapEvents normally include descendant events and reflect local counts on a mount with memory_localevents. Each read is an independent snapshot. Counter maps preserve unfamiliar keys and let callers distinguish a missing key from a reported zero. A missing control file returns the underlying error. The runnable memory-stat example checks whether an optional field is present.
Use ReclaimMemory to ask Linux to evict memory from an existing workload. For example, worker.ReclaimMemory(16<<20, 0) requests 16 MiB of file-cache reclaim. Pass ReclaimDefaultSwappiness to use kernel policy, a value from 0 to 200 to override it, or ReclaimAnonOnly to request the native swappiness=max mode. Affected Linux 7.0 kernels can evict file pages in this mode when anonymous pages cannot be reclaimed, including when swap is disabled. See the upstream fixes for classic LRU and multi-gen LRU.
The call is synchronous and the amount rounds down to whole pages. Linux may reclaim more than requested. An error matching EAGAIN means the kernel reclaimed less than requested, possibly zero. Interruption may also leave partial progress. Re-read usage before deciding whether to submit another command.
Read CPUPressure, MemoryPressure, IOPressure, or IRQPressure to inspect stalls in the group and its descendants. Use the cumulative microseconds in two readings to see how much stall time accumulated between them. The 10-, 60-, and 300-second trends are percentages. The some class counts times when at least one task stalled, and full counts times when every non-idle task stalled at once. Linux 7.0 IRQ pressure exports only full. Check map membership when consuming a class, since an absent class differs from a present zero.
snapshot, err := group.CPUPressure()
if err != nil {
return err
}
if some, ok := snapshot["some"]; ok {
fmt.Printf("CPU pressure %.2f%%, cumulative stall %d µs\n", some.Avg10, some.TotalMicroseconds)
}
ParsePressure decodes the same native records from captured data. Availability depends on kernel configuration and runtime PSI and IRQ accounting settings. Reads preserve the kernel’s error if the file is missing or the kernel refuses the read. If the group’s PSI accounting is disabled, its cumulative totals stop updating. Pressure thresholds, notifications, and accounting configuration are outside this API. Linux 7.0 PSI interface.
Enable cgroup.IO for the workload’s parent. Use the backing whole block device’s major and minor numbers. For a device node, file.Stat reports RdevMajor and RdevMinor. Layered storage can account I/O on a different device from the one visible to the application. Inspect IOStat after a representative workload to identify where Linux charges the I/O.
device := cgroup.Device{Major: 259, Minor: 0} // Use the workload's actual backing device.
if err := worker.SetIOMax(device, cgroup.IOLimits{ReadBPS: 16 << 20, WriteIOPS: 500}); err != nil {
return err
}
stats, err := worker.IOStat()
if err != nil {
return err
}
fmt.Println(stats[device].ReadBytes)
SetIOMax sends one update for one device. Zero fields leave the corresponding limits in place. UnlimitedIORate clears a field at this level while ancestor limits still apply. IOMax returns all four fields for each configured device. Linux omits devices with every field unlimited. The kernel can allow short bursts. Buffered writeback attribution depends on filesystem and device support. IOStat preserves extra policy fields as text, including fractional values. Linux 7.0 I/O controller.
SetIOWeight writes the group default from 1 to 10000. SetDeviceIOWeight adds a device override or removes it with InheritIOWeight. IOWeights returns the default and explicit overrides. Weight enforcement depends on the active block policy and competing I/O. The API preserves missing-file and unsupported-device errors from Linux.
Enable cgroup.CPUSet for the workload’s parent. Choose CPU and memory-node IDs using the parent’s EffectiveCPUs and EffectiveMemoryNodes. For example, this selects the first effective CPU for a worker.
cpus, err := group.EffectiveCPUs()
if err != nil {
return err
}
if len(cpus) == 0 {
return errors.New("parent has no effective CPUs")
}
cpu := cpus[0].First
if err := worker.SetCPUs(cgroup.IDSet); err != nil {
return err
}
CPUs and MemoryNodes report the configured lists. An empty list requests inheritance. The effective lists show the online resources Linux granted under the parent hierarchy. Read them after configuration since topology and parent policy can affect the result. Use SetMemoryNodes before starting or attaching a worker when possible. Changing the list for running tasks can migrate pages. IDSet implements the sparse Linux list text format using inclusive ranges.
SetExclusiveCPUs configures CPUs for partition use. ExclusiveCPUs and EffectiveExclusiveCPUs expose the request and the eligible CPUs. SetPartition writes PartitionMember, PartitionRoot, or PartitionIsolated. The partition file is controlled by the parent and Linux excludes it from delegation. Read Partition after changing it because Linux can accept a request and report a degraded partition with a reason. Promotion depends on the parent, sibling exclusivity, and online CPU topology. IsolatedCPUs reports isolated CPUs at the actual hierarchy root. Each control is a separate write. Linux 7.0 cpuset controller.
Enable cgroup.HugeTLB for children from an empty delegated parent. In a workload group, HugeTLBPageSizes() discovers visible page sizes in bytes. An empty list means the group has no HugeTLB control files. This includes the actual hierarchy root and children whose parent has not enabled the controller. Linux supplies files for supported page sizes even when their system pools are empty.
sizes, err := workload.HugeTLBPageSizes()
if err != nil {
return err
}
for _, size := range sizes {
if err := workload.SetHugeTLBMax(size, cgroup.HugePageReservation, 0); err != nil {
return err
}
}
HugeTLBMax, SetHugeTLBMax, and HugeTLBCurrent select HugePageReservation or HugePageFault independently for each size. Reservation accounting can begin during mapping. Fault accounting tracks pages in use. Linux rounds finite byte limits down to a whole page and can reject a reduction below current usage with EBUSY. cgroup.Max removes the local cap. Ancestor caps and preallocated pool availability still govern charges. Missing files match os.ErrNotExist. Kernel permission and read-only errors retain their errno.
HugeTLBEvents includes descendant charge refusals and HugeTLBEventsLocal attributes them to the group attempting the charge, even when an ancestor enforces the cap. Both charge types contribute to max. HugeTLBNUMAStat reports faulted bytes under total and native node keys such as N0. Reads are independent snapshots. The library leaves pool provisioning to the host and policy for transparent huge pages to the mechanisms that manage those pages. Linux 7.0 HugeTLB controller implementation.
Enable cgroup.RDMA for children from an empty delegated parent. In a workload group, RDMAMax lists the registered device names and local limits, including idle devices with unlimited resources. RDMACurrent gives a separate snapshot of usage charged to the group and its descendants. Both preserve additional resource names supplied by Linux. Charges follow the group that allocated the resource and are released when it is destroyed. Moving a process leaves existing charges with their original group.
Use the device key from either snapshot when setting a limit. Linux 7.0 reports a bare name such as rxe0. Starting with Linux 7.3, devices in different network namespaces can share a name. In that case the key includes the system-wide device index, for example cgroup.RDMADevice("rxe0 index=5"). A name-only write for those devices returns ENOTUNIQ. Linux 7.3 RDMA device keys.
device := cgroup.RDMADevice("rxe0")
if err := workload.SetRDMAMax(device, map[cgroup.RDMAResource]cgroup.Limit{
cgroup.HCAHandle: 2,
cgroup.HCAObject: 128,
}); err != nil {
return err
}
One write updates the supplied resources for one device. Omitting a resource preserves its limit, zero refuses new charges, and cgroup.Max clears the local cap. Finite limits run through 2³¹−2. Ancestor caps continue to constrain new allocations, which can fail with EAGAIN. Existing allocations remain charged after a limit reduction. The host supplies the RDMA devices and determines device access. Linux 7.0 RDMA controller.
A VM manager can cap the AMD SEV address space identifiers charged to one workload subtree. Enable cgroup.Misc for children of the empty delegated parent, then write the cap on the workload group.
if err := workload.SetMiscMax(cgroup.MiscSEV, 1); err != nil {
return err
}
usage, err := workload.MiscCurrent()
if err != nil {
return err
}
fmt.Println(usage[cgroup.MiscSEV])
MiscCapacity reads configured platform counts at the real hierarchy root. A delegated or namespace root may lack this file. MiscMax reads local limits for configured resources. MiscCurrent and MiscPeak report current charges and the lifetime watermark for the group and its descendants. An empty snapshot can be valid on a host with no configured resource. Check map membership to distinguish an absent resource from a reported zero. Snapshots preserve additional names supplied by Linux.
SetMiscMax writes one resource at a time. Zero denies new charges and cgroup.MiscUnlimited clears the local cap. Finite limits run through 2⁶⁴−2 and can exceed capacity. Ancestor caps and platform capacity still constrain allocations. Charges remain with the allocating group until release, including after process migration. The host supplies the resource providers and capacity.
MiscEventsLocal attributes a refusal to the group whose limit was reached, including refusals of descendant charges. MiscEvents includes refusals attributed to descendant groups. Both preserve the kernel’s full keys, such as sev.max. Linux exposes the limit and event files only on non-root groups with the controller enabled.
A recognized resource without registered capacity returns Linux EINVAL on write. Unsupported resource names match EOPNOTSUPP and malformed names match os.ErrInvalid. Missing files match os.ErrNotExist; permission and read-only filesystem errors retain their kernel identities. Linux 7.0 misc controller.
An unregistered device is absent from a read snapshot and returns ENODEV on a write. Missing rdma.max or rdma.current files match os.ErrNotExist, including at the actual hierarchy root or when the controller is disabled. Writes of unknown resource names match EOPNOTSUPP; permission errors retain their kernel errno.
A GPU workload manager can cap VRAM charges to a delegated subtree. Enable cgroup.Dmem for children of the empty delegated parent. Use the region key reported by DmemCurrent or DmemMax for the workload group. A key such as drm/0000:03:00.0/vram0 includes both device and region identity.
if err := workload.SetDmemMax(region, 2<<30); err != nil {
return err
}
limits, err := workload.DmemMax()
if err != nil {
return err
}
limit, present := limits[region]
if !present {
return fmt.Errorf("device-memory region %q disappeared before readback", region)
}
fmt.Println(limit)
DmemCapacity reads driver-registered capacity in bytes from the real hierarchy root. The driver may reserve part of that capacity for its own use. DmemCurrent reads charges for the group and its descendants. Charges stay with the allocating group after a process moves and end when the driver releases them. DmemPeak reads lifetime peak usage on kernels that expose dmem.peak. It returns os.ErrNotExist on Linux 7.0. cgroup.Max preserves the kernel’s saturation marker in usage and peak records. Each read is an independent snapshot. Check map membership to distinguish an absent region from a zero count. Linux 7.0 controller, Linux 7.3 peak accounting.
Each write sets one region’s value in bytes. Zero requests refusal of new charges through SetDmemMax, and cgroup.Max clears the local hard cap. Ancestor limits still apply. SetDmemMin requests hard eviction protection and SetDmemLow requests best-effort protection. Zero clears either protection setting, and cgroup.Max requests the kernel’s maximum. Effective protection depends on the hierarchy, usage, and the driver’s eviction behavior. Read the setting back when it matters. Linux 7.0 can acknowledge a hard-cap write below current usage while keeping the old cap. Linux 7.0 controller, counter implementation.
The library sends region keys as control-file data. Writes reject absolute keys, empty or dot components, and whitespace or control characters. Linux 7.0 reports EINVAL for an unregistered region and can report ENODEV during unregistration. An unavailable controller file or an operation absent from the running kernel matches os.ErrNotExist. Permission and read-only errors retain their kernel errno. Device setup, allocation placement, and driver-specific eviction belong to the caller and its driver. Linux 7.0 device-memory interface.
Events() reads cgroup.events once. For notifications, call WatchEvents() before taking the initial snapshot, set a read deadline, then call Read() or iterate Events() on the returned watcher. Watch registration uses the event file’s pinned identity through /proc/self/fd; procfs at /proc and inotify support are prerequisites. There is no background goroutine.
An Event reports current Populated and Frozen state and retains unknown unsigned fields. Notifications coalesce and may report the same state again; they are hints to reconcile a snapshot, not a lossless transition log. Read waits for a notification rather than returning an initial snapshot. Queue overflow matches ENOBUFS; reread the group’s state before resuming. Removal/unmount matches os.ErrNotExist. While waiting, Read checks the pinned event file every 100 milliseconds to detect removal even when Linux emits no inode notification; scheduling can delay detection. These checks neither return snapshots nor expire the caller’s deadline. The real hierarchy root lacks cgroup.events and normally returns ENOENT; namespace-root mounts can expose a non-root group’s file. See populated notification.
Use one watcher reader/iterator at a time; Close and SetReadDeadline can run concurrently. Close interrupts a pending read with os.ErrClosed; deadlines match os.ErrDeadlineExceeded. Iteration yields a terminal error once, then ends. Breaking performs no further I/O, and reusing the same sequence resumes until a terminal error. Group operations are safe concurrently, but sequences of configuration and lifecycle calls require caller coordination. Zero owners match os.ErrInvalid; repeated close and valid operations after closure match os.ErrClosed. Invalid arguments precede closed state. Kernel errors preserve errno; missing controllers, wrong topology, permission failures, and read-only mounts remain distinguishable.
Freeze() requests a pause for the group and all its descendants. Run the manager outside the target subtree so it can observe and reverse the freeze. For a temporary pause, coordinate all writes to the group’s local freeze request for the full operation and check FreezeRequested() first. If a request is already set, leave it in place. Calling Freeze() again leaves the same request set, and Thaw() clears it.
To wait for completion, open a watcher before requesting the freeze, set a read deadline, and check Events().Frozen after the request. If the snapshot is still unfrozen, read subsequent watcher snapshots until one reports a freeze or the deadline expires. After setting your own freeze request, call Thaw() when the work is done or if waiting fails. See the runnable freezer example.
FreezeRequested() reads the group’s local request from cgroup.freeze. Event.Frozen reports observed state from cgroup.events, including freezes inherited from an ancestor. Thaw() clears the local request, so tasks can resume once ancestor freezes and any other suspension conditions are cleared. The two reads are separate snapshots. Processes can still migrate into or out of a frozen group, and fatal signals can kill frozen processes.
Kill() asks Linux to send SIGKILL to processes in the group and all descendants. Linux handles concurrent forks and migrations during the operation. A successful call leaves process exit and reaping asynchronous. Use a bounded wait on Event.Populated to observe an empty subtree and reap your children separately. Processes can enter the subtree after the kill, so coordinate new admissions with teardown. Keep the controller process outside the targeted subtree.
The real hierarchy root has neither cgroup.freeze nor cgroup.kill. The kernel rejects a kill on a threaded group with EOPNOTSUPP. The caller needs write permission on the appropriate control file. Closing a handle only releases its directory reference. See the Linux 7.0 cgroup interface files.
The named mutation controllers are CPU, cpuset, dmem, HugeTLB, I/O, memory, misc, PIDs, and RDMA. The I/O surface covers io.max, io.weight, io.stat, and io.pressure. Device policy setup and I/O latency and priority controls belong to callers. Linux 7.0 cgroup v2.
Memory NUMA breakdown, OOM group policy, memory peak reset, and zswap controls are outside the current set.
The package targets delegated v2 domain groups. Mounting, managing ancestors or systemd, delegating permissions, configuring threaded hierarchies, and BPF device-access policy belong to callers and their host tools. Closing a group releases its local handle.
See executable examples, the design rationale, and verification requirements and delegated runtime evidence. Known defensive execution limits are recorded in verification limits.