You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each test block already runs through one isolated loop in
Runtime.runPathWithProvider (vm.callGlobal per __test_N global,
sequential, pass/fail tracked) -- exactly the wrapping point needed,
making this smaller than its P3/v0.9.0 label suggested.
Stack peak reuses the verifier-proved f.max_stack bound
enterFunctionFrame*/already checks on every call -- an upper bound on
capacity used, zero new cost on the push/pop hot path. Heap/object
peaks hook the 8 allocation success points (GC only ever shrinks
usage, never raises it, so allocation time is sufficient). Ops count
forces the existing budget-accounting dispatch path on for the run
(normally skipped via a batched heartbeat when no real max_ops is
set) -- the one part of this with a real, expected speed cost.
All three gated behind a new Policy.profile_mode field, zero cost
when off. tools/time-bench.sh compare shows no regression on any
benchmark.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,18 @@
2
2
3
3
This changelog tracks notable language/runtime changes by implementation date.
4
4
5
+
## 2026-07-21 (latest) (v0.5.1-dev)
6
+
7
+
### Tooling — `gengo --test --profile` (#58)
8
+
9
+
Each `test` block already compiles to a synthetic `__test_N` global run through one isolated loop in `Runtime.runPathWithProvider` (`vm.callGlobal`, sequential, pass/fail tracked) — that loop turned out to be exactly the wrapping point #58 needed, making this a smaller change than its `P3`/`v0.9.0` label suggested.
10
+
11
+
-**Stack peak**: reuses the verifier-proved `f.max_stack` bound `enterFunctionFrame`/`enterFunctionFrameWarm` already check on every call (`ctx.vs.stack_top + f.max_stack`) — an upper bound on capacity used, not a per-push sampled maximum, so it costs one extra branch at an already-existing call-entry checkpoint instead of touching the push/pop hot path at all.
12
+
-**Heap bytes / live objects peak**: `usedBytes()`/`liveObjectCount()` only ever grow at allocation time (GC only shrinks them), so checking-and-updating a peak at `vmAllocObject`/`vmAllocManagedSlice`/`vmAllocManagedBytes`'s 8 success points is sufficient to capture the true peak.
13
+
-**Ops count**: `ops_budget_remaining` only decrements when a real `max_ops` budget is set — an unbudgeted run takes a batched "heartbeat" dispatch path specifically to avoid a per-instruction accounting cost. `profile_mode` forces the interval to 1 (tick every instruction) with no real budget, so `budget_before - budget_after` gives an exact per-block count; this is the one part of the feature with a real, expected runtime cost (a diagnostic flag, not something to run by default).
14
+
15
+
All three are gated behind a new `Policy.profile_mode` field, zero cost when off. Verified with `tools/time-bench.sh compare`: no measurable regression on any benchmark.
16
+
5
17
## 2026-07-21 (later) (v0.5.1-dev)
6
18
7
19
### Embedding — std natives are no longer host-overridable
Copy file name to clipboardExpand all lines: docs/changelog.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,10 @@
26
26
-**`cap:env`** — New capability module for process environment access. `env.get(name)` returns `string|null`; `env.list()` returns `[string]string`. Requires the host to enable the `env` capability; a script importing `cap:env` without host permission fails at compile time.
27
27
-**`std.Arg`** — Built-in variant covering all primitive scalar types (`Int`, `Float`, `Decimal`, `Rune`, `Bool`, `Str`, `Err`). Use it to write type-safe heterogeneous variadic functions without exposing `any`.
28
28
29
+
### Tooling (unreleased)
30
+
31
+
-**`gengo --test --profile`** — reports each `test` block's instruction count and peak heap bytes/stack depth/live object count, plus a final peak-across-all-blocks summary line, so integrators can size `engine_init_with_config`'s resource ceilings from measured workload data instead of guessing. Does not affect pass/fail behavior or the exit code; does cost real speed (forces per-instruction accounting on for the run), so it's a diagnostic flag, not something to leave on by default.
32
+
29
33
### Fixes (unreleased)
30
34
31
35
- Struct and enum variable declarations following a `std` import no longer trigger a spurious "unknown field in std" compile error.
Copy file name to clipboardExpand all lines: docs/cli.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ script from standard input instead.
35
35
|`--version`| Print the CLI version and exit. |
36
36
|`--disasm`| Compile and print a bytecode disassembly without running the script. This is an implementation-debugging aid, not language semantics. |
37
37
|`--test`| Run top-level `test` blocks rather than ordinary script execution. A failed test exits unsuccessfully. |
38
+
|`--profile`| With `--test`, print each block's instruction count and peak heap bytes/stack depth/live object count, plus a final peak-across-all-blocks summary line. Does not affect pass/fail behavior or the exit code. Forces per-instruction instruction counting on for the run, which costs real speed — a diagnostic aid, not something to leave on by default. |
38
39
|`--cap name`| Enable one named capability. Repeat for several capabilities. See `capabilities.md`; no capability is enabled merely by importing it. |
39
40
|`--modules path`| Permit source imports from one additional directory. Repeatable, up to eight paths. The script directory remains the default source root. |
40
41
|`--max-ops n`| Limit VM instruction execution to `n`. `0` means unlimited. This limit does not account for work inside host callbacks. |
0 commit comments