debugger: layout table and gdb pretty printers for a native build (step 2 of #42) #469

Closed
opened 2026-10-24 07:09:04 +00:00 by orion · 9 comments
Collaborator

Context

Step 2 of #42 (epic: debug native programs, DEBUGGER.md section 4). Step 1 (#405, torb build --debug, a #line per statement, tools/debug-lines.sh) is on main. A debugger now stops on the right TorbScript line, but shows torb_text, torb_list and torb_map as raw C structs and a slot as s12_count. Section 4 plans "pretty printers for gdb (Python) and lldb (formatters) ... from a table the emitter writes".

Source

DEBUGGER.md sections 4, 11 and 18

Goal

A torb build --debug binary written to a gdb session shows a String, List, Map, Set and the program's own records and cases the way section 11 shows them.

Acceptance criteria

  • torb build --debug writes a layout table next to the binary (build/debug/<name>.layouts, a text format documented in DEBUGGER.md section 4): for each record, tuple and case type the program uses, its C type name, its TorbScript name and its fields (name, C member, element type); for each List/Map/Set instance, its element type's C name and size. A debugged build without a layout of some type still builds (the type is then shown raw). Without --debug no table is written and the C is byte for byte unchanged (emit-c.test.trb)
  • The table is covered by compiler tests: a fixture with a record, a case with payloads, a nested list and a map gives the expected table text
  • tools/gdb/torb_printers.py (gdb Python, loaded by -iex "source ..."; no auto-load into the binary) registers pretty printers for torb_text ("text", cut after 1000 characters), torb_list ([1, 2, 3] up to ten items, List(n) beyond, children in item order), torb_map, torb_set ([a: 1], Set(n)) and the table's records and cases (Point(x: 1, y: 2), .Circle(radius: 2.0), None); a null storage pointer shows as <none>; it also maps s12_count to count in info locals
  • A gate in tier B (tools/debug-values.sh, over a new tests/debug-values/ fixture) builds the fixture with --debug, runs gdb --batch to a breakpoint on the fixture's last statement and compares the printed locals with the expected text. Where gdb (with Python) is not installed it skips with a message, as tools/debug-lines.sh does. The measured result (is gdb on the CI runner image) goes into the PR body; if it is missing, the gate only runs the table check and a follow-up PR installs it on the image
  • DEBUGGER.md section 4 ("What the later phase adds"), section 11 (native column) and section 18 get a slice row for this step, marked Done; docs/tooling/ mentions the table and the printer script

Seed

Adds a file torb build --debug writes; no syntax, native, driver flag or looked-up std name changes. No seed refresh needed. A refresh would stay Torben's.

Size

One PR, two Conventional Commits: feat(backend): write a layout table for a debugged native build (emitter, emit-c and table tests), feat(debugger): gdb pretty printers for the layout table (script, gate, docs). The lldb formatters are not part of this step: they reuse the same table and become step 3, so the epic's remaining steps become lldb formatters, torb debug for a native program, docs and editor launch.

Dependencies

After #405 (landed). Independent of #39 and #403; DEBUGGER.md sections 11/18/20 overlap, rebase after whichever lands first.

Part of #42.

## Context Step 2 of #42 (epic: debug native programs, DEBUGGER.md section 4). Step 1 (#405, `torb build --debug`, a `#line` per statement, `tools/debug-lines.sh`) is on `main`. A debugger now stops on the right TorbScript line, but shows `torb_text`, `torb_list` and `torb_map` as raw C structs and a slot as `s12_count`. Section 4 plans "pretty printers for gdb (Python) and lldb (formatters) ... from a table the emitter writes". ## Source [DEBUGGER.md sections 4, 11 and 18](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/DEBUGGER.md) ## Goal A `torb build --debug` binary written to a gdb session shows a `String`, `List`, `Map`, `Set` and the program's own records and cases the way section 11 shows them. ## Acceptance criteria - [ ] `torb build --debug` writes a layout table next to the binary (`build/debug/<name>.layouts`, a text format documented in DEBUGGER.md section 4): for each record, tuple and case type the program uses, its C type name, its TorbScript name and its fields (name, C member, element type); for each `List`/`Map`/`Set` instance, its element type's C name and size. A debugged build without a layout of some type still builds (the type is then shown raw). Without `--debug` no table is written and the C is byte for byte unchanged (`emit-c.test.trb`) - [ ] The table is covered by compiler tests: a fixture with a record, a case with payloads, a nested list and a map gives the expected table text - [ ] `tools/gdb/torb_printers.py` (gdb Python, loaded by `-iex "source ..."`; no auto-load into the binary) registers pretty printers for `torb_text` (`"text"`, cut after 1000 characters), `torb_list` (`[1, 2, 3]` up to ten items, `List(n)` beyond, children in item order), `torb_map`, `torb_set` (`[a: 1]`, `Set(n)`) and the table's records and cases (`Point(x: 1, y: 2)`, `.Circle(radius: 2.0)`, `None`); a null storage pointer shows as `<none>`; it also maps `s12_count` to `count` in `info locals` - [ ] A gate in tier B (`tools/debug-values.sh`, over a new `tests/debug-values/` fixture) builds the fixture with `--debug`, runs `gdb --batch` to a breakpoint on the fixture's last statement and compares the printed locals with the expected text. Where `gdb` (with Python) is not installed it skips with a message, as `tools/debug-lines.sh` does. The measured result (is `gdb` on the CI runner image) goes into the PR body; if it is missing, the gate only runs the table check and a follow-up PR installs it on the image - [ ] DEBUGGER.md section 4 ("What the later phase adds"), section 11 (native column) and section 18 get a slice row for this step, marked Done; `docs/tooling/` mentions the table and the printer script ## Seed Adds a file `torb build --debug` writes; no syntax, native, driver flag or looked-up std name changes. No seed refresh needed. A refresh would stay Torben's. ## Size One PR, two Conventional Commits: `feat(backend): write a layout table for a debugged native build` (emitter, `emit-c` and table tests), `feat(debugger): gdb pretty printers for the layout table` (script, gate, docs). The lldb formatters are not part of this step: they reuse the same table and become step 3, so the epic's remaining steps become lldb formatters, `torb debug` for a native program, docs and editor launch. ## Dependencies After #405 (landed). Independent of #39 and #403; DEBUGGER.md sections 11/18/20 overlap, rebase after whichever lands first. Part of #42.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:15:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:15:00Z
Author
Collaborator

[loop:torbscript] implement checkpoint (context guard, no code written yet). Tokens used: about 95k

Done: read LOOP.md, #42 and #469 decisions, CLAUDE.md, DEBUGGER.md (sections 4, 11, 18, 20), the --debug commit 3dc7b716 (cli/build.trb, main.trb, usage.trb, tools/debug-lines.sh, tests/debug-lines/) and the C type layer. Worktree ws wt new torbscript/language 469 layouts --branch loop/469-layout-table-gdb-printers exists (clean, nothing committed or pushed).

Findings for the next worker:

  • Layout data comes from IrProgram.layouts (ir/layout.trb: Layout.name is the C type name, kind Record/Variant/Tuple, fields with memberNameOf = f_<name>, variants with variantMemberNameOf = v<n>, representation Inline/Boxed/Niche(variant, field), commonFieldCount); C type spelling in backend/c/type.trb (cTypeOf). Only used layouts are emitted (usedLayoutsOf in backend/c/emit.trb), the table should follow that set. Element descriptors (ElementDescriptor, ir/ir.trb:266) give List/Map/Set element types.
  • Runtime structs: torb_text {storage, offset, length}, torb_list {storage, offset, length}, torb_map {storage} in runtime/include/torb.h:883-931 (set at the same place); read those for the gdb printers.
  • Plan: commit 1 feat(backend): write a layout table for a debugged native build (new backend/c/layouts.trb emitting the text, hook in cli/build.trb next to the binary when options.debug, tests in compiler/tests/emit-c.test.trb or a new layout-table.test.trb, format documented in DEBUGGER.md section 4); commit 2 feat(debugger): gdb pretty printers for the layout table (tools/gdb/torb_printers.py, tools/debug-values.sh + tests/debug-values/, gate line in tools/gates.sh tier B next to debug-lines, DEBUGGER.md sections 4/11/18 slice 8 Done, docs/tooling/ note, regenerate skills/ with build/release/torb.exe docs skill docs skills only if CI-side tooling allows; otherwise check how the docs gate expects it).
  • Not yet checked: whether gdb is on the forge CI runner image (measure in the PR; the gate skips with a message if missing).

next: implement continues in a fresh worker (claim stays with session:loop-torbscript-20261024).

[loop:torbscript] implement checkpoint (context guard, no code written yet). Tokens used: about 95k Done: read LOOP.md, #42 and #469 decisions, CLAUDE.md, DEBUGGER.md (sections 4, 11, 18, 20), the `--debug` commit 3dc7b716 (cli/build.trb, main.trb, usage.trb, tools/debug-lines.sh, tests/debug-lines/) and the C type layer. Worktree `ws wt new torbscript/language 469 layouts --branch loop/469-layout-table-gdb-printers` exists (clean, nothing committed or pushed). Findings for the next worker: - Layout data comes from `IrProgram.layouts` (`ir/layout.trb`: `Layout.name` is the C type name, `kind` Record/Variant/Tuple, `fields` with `memberNameOf` = `f_<name>`, `variants` with `variantMemberNameOf` = `v<n>`, `representation` Inline/Boxed/Niche(variant, field), `commonFieldCount`); C type spelling in `backend/c/type.trb` (`cTypeOf`). Only used layouts are emitted (`usedLayoutsOf` in `backend/c/emit.trb`), the table should follow that set. Element descriptors (`ElementDescriptor`, `ir/ir.trb:266`) give List/Map/Set element types. - Runtime structs: `torb_text` {storage, offset, length}, `torb_list` {storage, offset, length}, `torb_map` {storage} in `runtime/include/torb.h:883-931` (set at the same place); read those for the gdb printers. - Plan: commit 1 `feat(backend): write a layout table for a debugged native build` (new `backend/c/layouts.trb` emitting the text, hook in `cli/build.trb` next to the binary when `options.debug`, tests in `compiler/tests/emit-c.test.trb` or a new `layout-table.test.trb`, format documented in DEBUGGER.md section 4); commit 2 `feat(debugger): gdb pretty printers for the layout table` (`tools/gdb/torb_printers.py`, `tools/debug-values.sh` + `tests/debug-values/`, gate line in `tools/gates.sh` tier B next to debug-lines, DEBUGGER.md sections 4/11/18 slice 8 Done, `docs/tooling/` note, regenerate `skills/` with `build/release/torb.exe docs skill docs skills` only if CI-side tooling allows; otherwise check how the docs gate expects it). - Not yet checked: whether `gdb` is on the forge CI runner image (measure in the PR; the gate skips with a message if missing). next: implement continues in a fresh worker (claim stays with session:loop-torbscript-20261024).
Author
Collaborator

[loop:torbscript] implement checkpoint 2 (context guard at ~80k, still no code written; design settled, next worker should only write code). Tokens used: about 85k

Worktree code/wt/torbscript-language-469-layouts (branch loop/469-layout-table-gdb-printers) is clean, at main 45f5ba05, nothing committed or pushed.

Settled design (do not re-research):

  • Reuse the IR text type syntax for every type in the table: ir/print.trb describeIrType (Int64, String, Record(T_main_Point), Variant(..), Tuple(..), Shared(..), List(Int64), Map(String, Int64), Array(Float64, 3)). Document that grammar in DEBUGGER.md section 4.
  • Layout has no source name (only mangled name + origin: SymbolId). Add declaredName: String = "" to Layout (ir/layout.trb), set it in buildNominalLayout (ir/instantiate.trb ~line 395, in the layout.copy(origin: signature.symbol, ...)) from symbolPathOf(checker, signature.symbol).name. Tuples keep "". Does not change the C or printLayout.
  • New compiler/src/backend/c/layouts.trb: layoutTableOf(program, used: List<Bool>): String, pure text, deterministic (layouts sorted by name, elements sorted by name). Make usedLayoutsOf and emittedFunctionsOf (already public) reachable from emit.trb (make usedLayoutsOf public) so build.trb can call layoutTableOf(program, usedLayoutsOf(program, emittedFunctionsOf(program))). Layouts to list: used ones with hasStructDefinition or niche; skip kinds Environment/Payload/Box/Cell.
  • Text format (line based, tokens split on one space, a type is the rest of the line):
    torb-layouts 1
    record <CName> <declaredName> <repr> / case <CName> <declaredName> <repr> / tuple <CName> <repr>; repr is inline, boxed or niche/<variant>/<field>
    field <name> <cMember> <type...> (record, tuple, and the common fields of a case)
    variant <index> <name> followed by field <name> <cMember> <type...> per payload field (cMember is the v<n>.f_<name> path inside the payload union: payload.v1.f_radius)
    element <descriptorName> <size> <alignment> <type...> for every program.elements entry (the descriptors are static const torb_element d_<Type> in the C, so gdb can find them by symbol)
    The runtime's own torb_element_int64/torb_element_text are not in the table; the printer knows them (Int64, String).
  • Hook: cli/build.trb after emitProgram (~line 379) and File.createDirectory(directory), only if options.debug: write <binary minus .exe>.layouts via File.writeText; without --debug write nothing (also delete a stale table? no, leave it). Binary dir is build/debug/.
  • Printer finds a list/map/set element type at runtime through storage->element (torb_list_storage.element, torb_map_storage.key/.value, runtime/include/torb.h:896-920): compare its address with &<descriptorName> of each table element. torb_set is torb_map with value descriptor torb_element_unit (size 0). Item order: list items start at storage + round-up(sizeof(torb_list_storage), align) + (offset + i) * size; map entries are insertion ordered in entries (entry_stride, key_offset, value_offset, tombstones marked by... read runtime/map.c for the tombstone test before writing the map printer).
  • Tests: add compiler/tests/layout-table.test.trb (fixture: record, case with payloads, nested list, map; compare exact table text; second test: a plain emitProgram is byte for byte the same with and without the table call, i.e. assert the C text is independent of it; follow how emit-c.test.trb lowers a snippet). Check compiler/tests/ir-layout.test.trb for a lowering helper.
  • Commit 2 as in checkpoint 1 (tools/gdb/torb_printers.py, tools/debug-values.sh modelled on tools/debug-lines.sh, tests/debug-values/, tier B line in tools/gates.sh, DEBUGGER.md 4/11/18, docs/tooling/torb-build.md). Skills regeneration needs build/release/torb.exe docs skill docs skills, which needs a bootstrap that is CI-only: if no binary is available, copy the docs change by hand into the matching skills/torbscript/references/tooling/torb-build.md as commit 3dc7b716 did (same text) and let the tier A --check gate confirm.

next: implement continues in a fresh worker (claim stays with session:loop-torbscript-20261024).

[loop:torbscript] implement checkpoint 2 (context guard at ~80k, still no code written; design settled, next worker should only write code). Tokens used: about 85k Worktree `code/wt/torbscript-language-469-layouts` (branch `loop/469-layout-table-gdb-printers`) is clean, at main 45f5ba05, nothing committed or pushed. Settled design (do not re-research): - Reuse the IR text type syntax for every type in the table: `ir/print.trb` `describeIrType` (`Int64`, `String`, `Record(T_main_Point)`, `Variant(..)`, `Tuple(..)`, `Shared(..)`, `List(Int64)`, `Map(String, Int64)`, `Array(Float64, 3)`). Document that grammar in DEBUGGER.md section 4. - Layout has no source name (only mangled `name` + `origin: SymbolId`). Add `declaredName: String = ""` to `Layout` (`ir/layout.trb`), set it in `buildNominalLayout` (`ir/instantiate.trb` ~line 395, in the `layout.copy(origin: signature.symbol, ...)`) from `symbolPathOf(checker, signature.symbol).name`. Tuples keep `""`. Does not change the C or `printLayout`. - New `compiler/src/backend/c/layouts.trb`: `layoutTableOf(program, used: List<Bool>): String`, pure text, deterministic (layouts sorted by `name`, elements sorted by `name`). Make `usedLayoutsOf` and `emittedFunctionsOf` (already public) reachable from `emit.trb` (make `usedLayoutsOf` public) so build.trb can call `layoutTableOf(program, usedLayoutsOf(program, emittedFunctionsOf(program)))`. Layouts to list: used ones with `hasStructDefinition` or niche; skip kinds Environment/Payload/Box/Cell. - Text format (line based, tokens split on one space, a type is the rest of the line): `torb-layouts 1` `record <CName> <declaredName> <repr>` / `case <CName> <declaredName> <repr>` / `tuple <CName> <repr>`; repr is `inline`, `boxed` or `niche/<variant>/<field>` ` field <name> <cMember> <type...>` (record, tuple, and the common fields of a case) ` variant <index> <name>` followed by ` field <name> <cMember> <type...>` per payload field (cMember is the `v<n>.f_<name>` path inside the `payload` union: `payload.v1.f_radius`) `element <descriptorName> <size> <alignment> <type...>` for every `program.elements` entry (the descriptors are `static const torb_element d_<Type>` in the C, so gdb can find them by symbol) The runtime's own `torb_element_int64`/`torb_element_text` are not in the table; the printer knows them (Int64, String). - Hook: `cli/build.trb` after `emitProgram` (~line 379) and `File.createDirectory(directory)`, only `if options.debug`: write `<binary minus .exe>.layouts` via `File.writeText`; without `--debug` write nothing (also delete a stale table? no, leave it). Binary dir is `build/debug/`. - Printer finds a list/map/set element type at runtime through `storage->element` (`torb_list_storage.element`, `torb_map_storage.key/.value`, runtime/include/torb.h:896-920): compare its address with `&<descriptorName>` of each table element. `torb_set` is `torb_map` with value descriptor `torb_element_unit` (size 0). Item order: list items start at storage + round-up(sizeof(torb_list_storage), align) + (offset + i) * size; map entries are insertion ordered in `entries` (`entry_stride`, `key_offset`, `value_offset`, tombstones marked by... read runtime/map.c for the tombstone test before writing the map printer). - Tests: add `compiler/tests/layout-table.test.trb` (fixture: record, case with payloads, nested list, map; compare exact table text; second test: a plain `emitProgram` is byte for byte the same with and without the table call, i.e. assert the C text is independent of it; follow how `emit-c.test.trb` lowers a snippet). Check `compiler/tests/ir-layout.test.trb` for a lowering helper. - Commit 2 as in checkpoint 1 (`tools/gdb/torb_printers.py`, `tools/debug-values.sh` modelled on `tools/debug-lines.sh`, `tests/debug-values/`, tier B line in `tools/gates.sh`, DEBUGGER.md 4/11/18, `docs/tooling/torb-build.md`). Skills regeneration needs `build/release/torb.exe docs skill docs skills`, which needs a bootstrap that is CI-only: if no binary is available, copy the docs change by hand into the matching `skills/torbscript/references/tooling/torb-build.md` as commit 3dc7b716 did (same text) and let the tier A `--check` gate confirm. next: implement continues in a fresh worker (claim stays with session:loop-torbscript-20261024).
Author
Collaborator

[loop:torbscript] implement checkpoint 3 (context guard hit after steps a and b; nothing built or tested yet, CI only). Worker tokens: about 90k.

Pushed branch loop/469-layout-table-gdb-printers (worktree code/wt/torbscript-language-469-layouts, remote origin = git.torb.dev, token ~/.secrets/torbdev-token; the forgejo skill's git.dmb.zone does not host torbscript), no PR yet.

Done:

  • a. f6ecf7f3 Layout.declaredName (ir/layout.trb, set in buildNominalLayout via symbolPathOf(...).name).
  • b. 2d203cc0 backend/c/layouts.trb (layoutTableOf(program, used), format in its header comment, - for an empty declaredName), usedLayoutsOf public, hook in cli/build.trb under options.debug writing <binary minus .exe>.layouts. Not compiled yet: first CI run may show syntax/type slips in layouts.trb (e.g. sort({ program.layouts[_].name }), Set.insert, seen.contains x without parentheses).

Remaining:

  • c. tools/gdb/torb_printers.py does not exist yet (nothing of gdb printers is written): torb_text/torb_list/torb_map/set printers, element type via storage->element address vs &<descriptorName> from the table; tools/debug-values.sh + tests/debug-values/; tier B line in tools/gates.sh.
  • d. compiler/tests/layout-table.test.trb (use lowered from ./lower-harness + insertOwnership like emit-c.test.trb; usedLayoutsOf(found.program, emittedFunctionsOf(found.program))).
  • e. DEBUGGER.md 4/11/18, docs/tooling/torb-build.md, mirrored into skills/torbscript/references/tooling/torb-build.md.
  • Open PR referencing #469, wait for CI.
[loop:torbscript] implement checkpoint 3 (context guard hit after steps a and b; nothing built or tested yet, CI only). Worker tokens: about 90k. Pushed branch `loop/469-layout-table-gdb-printers` (worktree `code/wt/torbscript-language-469-layouts`, remote `origin` = git.torb.dev, token `~/.secrets/torbdev-token`; the forgejo skill's git.dmb.zone does not host torbscript), no PR yet. Done: - a. f6ecf7f3 `Layout.declaredName` (ir/layout.trb, set in buildNominalLayout via `symbolPathOf(...).name`). - b. 2d203cc0 `backend/c/layouts.trb` (`layoutTableOf(program, used)`, format in its header comment, `-` for an empty declaredName), `usedLayoutsOf` public, hook in `cli/build.trb` under `options.debug` writing `<binary minus .exe>.layouts`. Not compiled yet: first CI run may show syntax/type slips in layouts.trb (e.g. `sort({ program.layouts[_].name })`, `Set.insert`, `seen.contains x` without parentheses). Remaining: - c. `tools/gdb/torb_printers.py` does not exist yet (nothing of gdb printers is written): torb_text/torb_list/torb_map/set printers, element type via `storage->element` address vs `&<descriptorName>` from the table; `tools/debug-values.sh` + `tests/debug-values/`; tier B line in `tools/gates.sh`. - d. `compiler/tests/layout-table.test.trb` (use `lowered` from `./lower-harness` + `insertOwnership` like `emit-c.test.trb`; `usedLayoutsOf(found.program, emittedFunctionsOf(found.program))`). - e. DEBUGGER.md 4/11/18, `docs/tooling/torb-build.md`, mirrored into `skills/torbscript/references/tooling/torb-build.md`. - Open PR referencing #469, wait for CI.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:30:00Z (continuation 3 of 3, from checkpoint 5996)

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T13:30:00Z (continuation 3 of 3, from checkpoint 5996)
Author
Collaborator

[loop:torbscript] implement checkpoint 4 (context guard hit; nothing built or tested locally, no torb binary here). Worker tokens: about 95k.

Branch loop/469-layout-table-gdb-printers pushed at 59484e9a (worktree code/wt/torbscript-language-469-layouts), no PR yet.

Done in 59484e9a:

  • layouts.trb: seen.contains(...) parenthesized; sort({ ... }), Set.of()/insert match existing compiler code.
  • c. tools/gdb/torb_printers.py (String/List/Map/Set/record/case/tuple printers, element type via descriptor address, frame filter s12_count -> count, commands torb-print, torb-locals, torb-layouts; py_compile clean), tools/debug-values.sh (builds tests/debug-values/ with --debug, checks the table, then gdb --batch torb-print per line of tests/debug-values/expected.txt; skips without gdb / off Linux), tier B gate line + header comment + tests/debug-values in the manifest --check list of tools/gates.sh.
  • d. compiler/tests/layout-table.test.trb (4 tests; assumes Int prints as Int64, Float as Float64, layout names T_acme_x2f_app_main_*).

Remaining:

  • e. docs: DEBUGGER.md section 4 (second step built), 11 (native: gdb printers, torb-print form), 18 (slice 8 row), status line; docs/tooling/torb-build.md ### --debug (line 218: the .layouts file + gdb -x tools/gdb/torb_printers.py), mirrored into skills/torbscript/references/tooling/torb-build.md (same section, line 218).
  • Squash the 3 branch commits into 1-2 Conventional Commits, check-commits.sh, rebase on main, open PR Closes #469, ci-wait; first CI may show .trb slips or format issues in layouts.trb / layout-table.test.trb.
[loop:torbscript] implement checkpoint 4 (context guard hit; nothing built or tested locally, no torb binary here). Worker tokens: about 95k. Branch `loop/469-layout-table-gdb-printers` pushed at 59484e9a (worktree `code/wt/torbscript-language-469-layouts`), no PR yet. Done in 59484e9a: - `layouts.trb`: `seen.contains(...)` parenthesized; `sort({ ... })`, `Set.of()`/`insert` match existing compiler code. - c. `tools/gdb/torb_printers.py` (String/List/Map/Set/record/case/tuple printers, element type via descriptor address, frame filter `s12_count` -> `count`, commands `torb-print`, `torb-locals`, `torb-layouts`; py_compile clean), `tools/debug-values.sh` (builds `tests/debug-values/` with --debug, checks the table, then gdb --batch `torb-print` per line of `tests/debug-values/expected.txt`; skips without gdb / off Linux), tier B gate line + header comment + `tests/debug-values` in the manifest --check list of `tools/gates.sh`. - d. `compiler/tests/layout-table.test.trb` (4 tests; assumes Int prints as `Int64`, Float as `Float64`, layout names `T_acme_x2f_app_main_*`). Remaining: - e. docs: DEBUGGER.md section 4 (second step built), 11 (native: gdb printers, `torb-print` form), 18 (slice 8 row), status line; `docs/tooling/torb-build.md` `### --debug` (line 218: the `.layouts` file + `gdb -x tools/gdb/torb_printers.py`), mirrored into `skills/torbscript/references/tooling/torb-build.md` (same section, line 218). - Squash the 3 branch commits into 1-2 Conventional Commits, check-commits.sh, rebase on main, open PR `Closes #469`, ci-wait; first CI may show .trb slips or format issues in layouts.trb / layout-table.test.trb.
Author
Collaborator

[loop:torbscript] release implement: continuation budget used up, checkpoint above, next: implement

[loop:torbscript] release implement: continuation budget used up, checkpoint above, next: implement
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261024-1000 until 2026-10-24T14:10:28Z

[loop:torbscript] claim implement by session:loop-torbscript-20261024-1000 until 2026-10-24T14:10:28Z
Author
Collaborator

[loop:torbscript] implement checkpoint 5 (context guard). Worker tokens: about 110k.

PR is open: #471 (Closes #469, two Conventional Commits, check-commits clean, rebased on main). Branch loop/469-layout-table-gdb-printers pushed at 3577d553, worktree code/wt/torbscript-language-469-layouts.

Done: docs (DEBUGGER.md 4/11/18/20 + status, torb-build.md and its skills mirror), squashed the 3 earlier commits plus docs into 2.
CI round 1 (bootstrap linux-x64, 4m25s) was red: layouts.trb:101 for field in layout.fieldsOfVariant index { is not valid (a command call in a for header); fixed to layout.fieldsOfVariant(index) and force-pushed (3577d553). CI round 2 is not yet watched; further .trb slips in layouts.trb, layout-table.test.trb or cli/build.trb are likely (never compiled), and the first run of tools/debug-values.sh / torb_printers.py has not happened.

Next worker: bash /opt/openclaw/skills/dev-workflow/scripts/ci-wait.sh -C <worktree> (the exec yields early; re-run or poll the status API for commit 3577d553), fix every red job on the same branch (fixup + git rebase -i --autosquash origin/main, --force-with-lease), then put the measured result "is gdb on the CI runner image" (tier B log of debug-values.sh: ran or skipped) into the PR body, then write-back [loop:torbscript] implement: PR #471 open, next: review (waiting on merge gate).

CONTINUE: torbscript/language#469

[loop:torbscript] implement checkpoint 5 (context guard). Worker tokens: about 110k. PR is open: https://git.torb.dev/torbscript/language/pulls/471 (`Closes #469`, two Conventional Commits, check-commits clean, rebased on main). Branch `loop/469-layout-table-gdb-printers` pushed at 3577d553, worktree `code/wt/torbscript-language-469-layouts`. Done: docs (DEBUGGER.md 4/11/18/20 + status, torb-build.md and its skills mirror), squashed the 3 earlier commits plus docs into 2. CI round 1 (bootstrap linux-x64, 4m25s) was red: `layouts.trb:101` `for field in layout.fieldsOfVariant index {` is not valid (a command call in a `for` header); fixed to `layout.fieldsOfVariant(index)` and force-pushed (3577d553). CI round 2 is not yet watched; further .trb slips in `layouts.trb`, `layout-table.test.trb` or `cli/build.trb` are likely (never compiled), and the first run of `tools/debug-values.sh` / `torb_printers.py` has not happened. Next worker: `bash /opt/openclaw/skills/dev-workflow/scripts/ci-wait.sh -C <worktree>` (the exec yields early; re-run or poll the status API for commit 3577d553), fix every red job on the same branch (fixup + `git rebase -i --autosquash origin/main`, `--force-with-lease`), then put the measured result "is gdb on the CI runner image" (tier B log of `debug-values.sh`: ran or skipped) into the PR body, then write-back `[loop:torbscript] implement: PR #471 open, next: review (waiting on merge gate)`. CONTINUE: torbscript/language#469
argus closed this issue 2026-10-24 11:38:12 +00:00
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#469
No description provided.