Skip to content

-ZONES 40-45 runs only the zones it names (4.2.50) - #810

Merged
ddehilster merged 2 commits into
masterfrom
feat/zone-range
Oct 28, 2026
Merged

ddehilster merged 2 commits into
masterfrom
feat/zone-range

Conversation

@ddehilster

Copy link
Copy Markdown
Member

Why

Zone mode had no way to run part of a document. Chasing a problem in zone 4,102 of War and Peace meant an 18-minute run, and -DEV wrote trees only for the first three zones.

What

nlp -ANA parse-en-us -ZONES 4100-4104 -DEV wp.txt

runs only those zones: 27 s without -DEV, 117 s with it, against 18.4 min for the whole book. With -DEV, every zone that runs writes all its pass trees (here 98 per zone, with the "1. Discretion" passage in z4102).

  • A spec is a zone number, a range or a list: 7, 40-45, 3,40-45. Numbers count from 1, as in the z040-ana###.tree names.
  • Zones outside the range get only the passes before the zone line; the passes after endzone still run. $isfirstzone / $islastzone mark the first and last zone that runs.
  • The KB and G() start without what the skipped zones would have added, so a zone that depends on earlier ones can differ from a full run.
  • stderr says how many zones ran; a bad spec (3-1) stops the run with exit 1.
  • NLP_ENGINE::setZoneRange() for the Python and Node bindings. The spec parser is in lite/zonerange.h, shared by main, NLP_ENGINE and Parse.
  • Zone dump names no longer wrap past 999 (z1234-, was z234-).
  • Interpreted and compiled analyzers share Parse::zoneLoop, so both honor it.
  • Version 4.2.50.

Tests

  • CI: the zone-mode fixture with -ZONES 2-3 (exact stdout, first/last flags, which z### trees exist), -ZONES 1,3, and a bad range, on Linux, macOS and Windows.
  • Locally (x86): without -ZONES the fixture output is unchanged; -ZONES 9 on a 3-zone file runs none and says so; War and Peace as above.

README: -ZONES, and memory goes by the skim tree as well as the largest zone.

🤖 Generated with Claude Code

Zone mode had no way to run part of a document: chasing a problem in
zone 4,102 of War and Peace meant an 18-minute run, and -DEV wrote trees
only for the first three zones. Now

    nlp -ANA parse-en-us -ZONES 4100-4104 -DEV wp.txt

runs only those zones, in 27 s without -DEV (117 s with it), and -DEV
writes every pass tree for each zone that runs. A spec is a zone number,
a range or a list: 7, 40-45, 3,40-45; numbers count from 1, as in the
z040-ana###.tree names.

- Zones outside the range get only the passes before the zone line; the
  passes after endzone still run. $isfirstzone and $islastzone mark the
  first and last zone that runs.
- The KB and G() start without what skipped zones would have added, so
  a zone that depends on earlier ones can differ from a full run.
- stderr says how many zones -ZONES ran; a bad spec ("3-1") stops the
  run with exit 1.
- NLP_ENGINE::setZoneRange() for the Python and Node bindings; the spec
  parser is in lite/zonerange.h, shared by main, NLP_ENGINE and Parse.
- Zone dump names no longer wrap past 999 (z1234-, was z234-).
- Interpreted and compiled analyzers share Parse::zoneLoop, so both
  honor it.
- CI: the zone-mode fixture with -ZONES 2-3, 1,3 and a bad range, on
  Linux, macOS and Windows. README: -ZONES, and memory goes by the
  skim tree too, not only the largest zone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heredoc edit had turned the step's '\r' and '\n' into real characters,
so the three workflow files did not parse and no build ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ddehilster
ddehilster merged commit 97c45f5 into master Oct 28, 2026
7 checks passed
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