Skip to content

feat: what the editor's debugger needs from the link and the compiler - #1208

Merged
vdmkenny merged 3 commits into
mainfrom
feat/editor-link-debugger
Oct 14, 2026
Merged

vdmkenny merged 3 commits into
mainfrom
feat/editor-link-debugger

Conversation

@vdmkenny

@vdmkenny vdmkenny commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

What the editor's debugger (openreliant-editor#5) needs from OpenReliant:

  • The compiler's line map. compileMapped gives, with the mission file, each statement's offset in the script, its line and column, and whether the VM stops before it. source_parser.buildMapped parses and compiles with it.
  • The link's records. link.Hello, link.MissionStarted and link.State write OpenReliant's own payloads and read them back, passing over keys they don't know. The game writes them and openreliant debug reads them, replacing the hand-parsed fields. The default port moves into the library beside them.
  • The start's wait. While an editor is linked, the mission's start waits for the editor's flags, for a second at most by the clock, checking the link every millisecond, instead of a fixed fifth of a second. Without an editor it doesn't wait. Marked as an improvement.

Checked: tests, make check-missions (44 missions, 75 bound, the guide's change), and headless with a fake editor that answers the mission file half a second late: mission 1 still stops before its start part's first instruction, with the clock at 0. The editor's #23 builds on it, and its --check-missions builds all 44 stock missions again through the mapped build.

Left for later: the script's events for the editor's timeline (#1207).

Closes #1206

The editor's debugger sets breakpoints on source lines, shows the line
the script is held at, and reads the script's state.

- The compiler can give a map from the source's lines to the script's
  statements (compileMapped, source_parser.buildMapped): each statement's
  offset, its place in the source, and whether the VM stops before it.
- OpenReliant's own messages are records in the library (link.Hello,
  link.MissionStarted, link.State), which the game writes and
  openreliant debug reads, so every client reads them the same way.
- While an editor is linked, the mission's start waits for the editor's
  flags, for a second at most, instead of a fixed fifth of a second, so
  a breakpoint in a start part stops it with a slower editor too.

Closes #1206
An editor built on the library connects to the port the game listens
at, so the number belongs with the link's other definitions rather
than in the game's platform module.
- The state reads in one pass over its lines, passes over keys it
  doesn't know, and refuses a global past the 16 bits a mission counts
  them in, which could otherwise allocate without bound.
- The start's wait reads a clock through the editor connection, so a
  second is a second however long each sleep takes.
- The compiler's marks note where a statement's last instruction goes,
  and the map reads that instruction back from the written routine, so
  the two can't disagree. The statements come in the script's order, so
  they need no sort.
- The test listener counts its releases as `released`, apart from the
  checks it counts as `checked`.
@vdmkenny
vdmkenny merged commit 0f92996 into main Oct 14, 2026
4 checks passed
@vdmkenny
vdmkenny deleted the feat/editor-link-debugger branch October 14, 2026 16:55
vdmkenny added a commit to OpenReliant/openreliant-editor that referenced this pull request Oct 14, 2026
)

The first stage of [the debugger's design](design/debugger.md), which
this PR adds with its Editor link settings page: the editor links to
OpenReliant, holds the mission's script at line breakpoints, and steps
it.

- **Linking:** Play starts the game with `--editor-link` and links to
it, Link to game links to a game started by hand, and Unlink closes the
link while the game plays on. The link's state shows on the toolbar's
chip, the status bar and the start screen.
- **Breakpoints:** placed by the build's map of statements to lines,
which OpenReliant's compiler gives, while the game plays the build of
the text as it is. A breakpoint on a line that can't hold moves to the
next one that can. They're kept per source file in the settings folder.
- **Holding and stepping:** Continue, Step over, Step into, Run to
cursor and Pause; the held line in the gutter, the outline, the
inspector and the chip; Threads and Variables from the game's state.
- **The connection** answers each mission's file with the flags from a
task of its own, since the game holds the mission's start until they
come.
- On-screen text is terse: Unlink, Link to game, State polling at 1 Hz
or 4 Hz. The design pages and pictures say the same.

Checked: tests including a game made of messages over TCP, `make check`,
`--check-missions` over the 44 stock missions, and the real game
headless, holding mission 90's start part at a breakpoint.

Depends on
[OpenReliant/openreliant#1208](OpenReliant/openreliant#1208):
`build.zig.zon` pins its head, to repin to main once it merges.

Left for later: conditions, log points and Watch (#19), the timeline
(#20), the live scene (#21) and live changes (#22).

Closes #5
vdmkenny pushed a commit that referenced this pull request Oct 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.15.0](v0.14.0...v0.15.0)
(2026-10-14)


### Features

* what the editor's debugger needs from the link and the compiler
([#1208](#1208))
([0f92996](0f92996)),
closes [#1206](#1206)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
vdmkenny added a commit to OpenReliant/openreliant-editor that referenced this pull request Oct 14, 2026
Pins OpenReliant at its v0.15.0 release instead of the head of
OpenReliant/openreliant#1208, which held the same code: their trees are
identical, so nothing the editor builds changes.
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.

The editor link: what the editor's debugger needs

1 participant