Skip to content

WIP: 1.5.0 row 9 — S4 three-state closure + break/continue word forms + S5 KPI - #1891

Merged
caomengxuan666 merged 2 commits into
masterfrom
feat150/s4-three-states
Oct 27, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
feat150/s4-three-states

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

WIP: 1.5.0 plan row 9 — S4 three-state closure + break/continue word forms

Base: master 54df3f8d (after row 8, PR #1890). Plan: PLAN.md row 9; design of record: docs/design/debugger-full-design.md §4.1/§4.4/§6/§7.4.

What lands

1. The S4 three states, closed (design §4.4). With no DEBUG action
installed the funnel's consult now has an explicit inert fast exit:
DebugSession::can_stop_at_seam (running ∧ (arming ≠ Continue ∨ an
enabled line/function entry exists)) plus the no-driver case for child
executors that share the process gate. When the predicate is false the
consult returns before the location read, the candidate scan, and the
stop-time $BASH_COMMAND refresh window — the inert shapes cost the
gate load plus one predicate, and their behavior is the un-consulted
path by construction. The one consult side effect that is not a stop
decision — the WP-8 function-definition note at entry seams — was
hoisted ahead of the fast exit so resolution bookkeeping is unchanged
(it feeds later insert-time adjudication and DE-11).

2. break/continue word forms inside a session. Stepping pins: the
break/continue commands are ordinary simple-command seams; break 2
unwinds two levels; the extdebug for-head skip (B-3: skip = this
iteration's continue, loop status = trap status, GNU
execute_cmd.c:3053-3059, oracle-verified) is unchanged by an attached
inert session. One real defect fixed: a control unwind typed at a stop
(exit/return/break 1/continue 1 in an explicit evaluation,
design §7.4) propagated out of the stop serve with the session still
Stopped — the debuggee was running again but no later breakpoint,
step, or frame-return note could ever land. The serve now mirrors the
ForceReturn route's discipline: resume (Continue) first, then raise.
Pre-fix pins fail (3), post-fix they pass; a typed return's DE-04
FrameReturned event is dark no longer.

Note on spelling: a bare single word (break) is a print-shaped
request under the WP-7 single-word routing — it expands, it does not
execute — so the executable spellings in the pins carry their count
(break 1), exactly as in a script.

3. S5 KPI (measure + archive only, no tuning). An ignored harness
(s4_kpi_4500_line_script_three_shapes) runs a 4500-line script three
ways — plain, inert session, and the stop-loop echo (StepInto: one
stop + immediate resume per line; the request/response surface the
row-10 DAP adapter will ride on — the adapter itself does not exist
yet). Numbers, with caliber and machine, are archived in the cluster
REPORT; nothing is asserted and no hot path was tuned.

Gates

…ore a typed evaluation unwind propagates

Row 9 of the 1.5.0 plan (debugger design sections 4.4, 7.4).

Three-state closure (4.4): the consult gains an inert fast exit.
DebugSession::can_stop_at_seam names the armed shapes (running, with
a stepping arming other than Continue or an enabled line/function
entry in the table; BreakpointTable::has_enabled_seam_entries is the
table half). When the predicate is false — including the no-driver
case for child executors that share the process gate — the consult
returns before the location read, the candidate scan, and the
stop-time $BASH_COMMAND refresh window: the inert shape costs the
gate load plus one predicate, and its behavior is the un-consulted
path by construction. The WP-8 function-definition note is not a
stop decision (it feeds later insert-time adjudication and DE-11),
so it is hoisted ahead of the fast exit and still lands on every
function-entry arrival while the session runs, before hit
accounting, exactly as before.

Typed-unwind resume (7.4): a control unwind typed at a stop
(exit/return/break/continue in an explicit evaluation) propagates
out of the stop serve as the debuggee's own flow — but it left the
session Stopped while the debuggee ran on, so no later breakpoint,
step, or frame-return note could ever land (the consult serves only
a running session). The serve now mirrors the ForceReturn route's
discipline: resume under Continue first, then raise the unwind.
…KPI harness

- Three-state corpus over the design 4.1 seam faces (simple command,
  [[ ]], (( )), time body, case head, arith-for init/test/update,
  for head, function entry, pipeline element, select head): plain,
  inert-session, and stepping runs must agree byte-for-byte on the
  observable outcome (status + accumulators); the inert session
  serves only the entry stop; the stepping session sees the face's
  seams. while heads never stop; a comsub body (driver-less child,
  DE-12) never stops; a synchronous subshell stops inside but its
  writes stay in the snapshot (design 6.3).
- Armed-but-inert shapes: all-disabled table, watch-only table, and
  a counting DEBUG trap whose firing count must equal the plain
  run's under both an inert and a stepping session.
- B-3 pin (WP-1 inventory; GNU execute_cmd.c:3053-3059, verified
  against the GNU 5.3.20 oracle): under extdebug a non-zero DEBUG
  trap status at the for head skips the iteration and leaves the
  trap's status as the loop's — identical with an inert session.
- break/continue in a session: step-into stop sequences across
  continue/break and break 2; and the typed-unwind battery — an
  explicit evaluation of `break 1` / `continue 1` / `return 7` /
  `exit 5` at a stop unwinds the debuggee's own flow and leaves
  the session alive (later breakpoints land; a typed return's
  DE-04 FrameReturned is reported). The break/continue/return
  pins fail on the pre-fix tree. Bare `break` is print-shaped
  under the WP-7 single-word routing, hence the counted spelling.
- S5 KPI harness (ignored by default): a 4500-line script run
  plain / inert / stop-loop echo (StepInto, one stop + resume per
  line — the surface the row-10 DAP adapter will ride on).
  Numbers are archived in the row REPORT, never asserted.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 20:59
@caomengxuan666
caomengxuan666 merged commit 015b4f9 into master Oct 27, 2026
11 checks passed
@caomengxuan666
caomengxuan666 deleted the feat150/s4-three-states branch October 30, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant