Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ clippy:
@cargo clippy --workspace --all-targets -- -D warnings

test:
@cargo nextest run --no-fail-fast --hide-progress-bar --status-level none --failure-output final
@cargo nextest run --no-fail-fast --show-progress only --status-level fail --failure-output final

shot:
@# See AGENTS.md for diagnostic guidelines
Expand Down
6 changes: 3 additions & 3 deletions crates/plotnik-cli/src/cli/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
//! Three knobs feed one [`RuntimeLimitSpec`]:
//! - `--max-steps <auto|unbounded|N>` work ceiling
//! - `--max-memory <auto|unbounded|SIZE>` live-heap ceiling (binary units)
//! - `--limits <auto|unbounded>` preset baseline for every resource
//! - `--limits <auto|unbounded>` preset baseline for both runtime resources
//!
//! Precedence is order-independent: `--limits` sets the baseline and an explicit
//! `--max-*` overrides that one resource. So `--limits unbounded --max-steps 5`
//! means "unbounded except steps = 5", regardless of flag order.
//! means "unbounded runtime limits except steps = 5", regardless of flag order.

use clap::{Arg, ArgMatches};
use plotnik_lib::{Limit, RuntimeLimitSpec};
Expand All @@ -33,7 +33,7 @@ pub fn limits_preset_arg() -> Arg {
.long("limits")
.value_name("PRESET")
.value_parser(["auto", "unbounded"])
.help("Limit preset for every resource: 'auto' (default) or 'unbounded'")
.help("Runtime limit preset: 'auto' (default) or 'unbounded'")
}

/// Combine the `--limits` preset baseline with per-resource `--max-*` overrides.
Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-cli/src/cli/limits_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn preset_sets_the_baseline_for_both() {

#[test]
fn per_field_override_beats_preset_regardless_of_order() {
// The plan's canonical case: unbounded everywhere except steps.
// The canonical case: unbounded runtime limits except steps.
let forward = spec_from(&["--limits", "unbounded", "--max-steps", "5"]);
let reversed = spec_from(&["--max-steps", "5", "--limits", "unbounded"]);
for spec in [forward, reversed] {
Expand Down
9 changes: 5 additions & 4 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ sized from the input so they stay invisible to legitimate queries:
| -------------- | ---------------------------------- | ------- |
| `--max-steps` | a step count, `auto`, `unbounded` | `auto` |
| `--max-memory` | a binary size, `auto`, `unbounded` | `auto` |
| `--limits` | `auto` or `unbounded` (preset) | `auto` |
| `--limits` | `auto` or `unbounded` runtime preset | `auto` |

- **Steps** bound total work (instruction dispatches) — the guard against
catastrophic backtracking.
Expand All @@ -293,9 +293,10 @@ sized from the input so they stay invisible to legitimate queries:
**Sizes** use binary units only: a bare integer is bytes; `KiB`/`MiB`/`GiB`
scale by 1024. SI units (`MB`, `GB`) are rejected as ambiguous — use `MiB`/`GiB`.

**Precedence** is order-independent: `--limits` sets the baseline for every
resource, and an explicit `--max-*` overrides that one. So `--limits unbounded
--max-steps 5` means "unbounded everywhere except steps = 5".
**Precedence** is order-independent: `--limits` sets the baseline for both
runtime resources, and an explicit `--max-*` overrides that one. So
`--limits unbounded --max-steps 5` means "unbounded runtime limits except
steps = 5".

```sh
plotnik run q.ptk app.js --max-steps 5000000 # explicit work ceiling
Expand Down