debugger: tasks as threads #41

Open
opened 2026-10-05 21:07:13 +00:00 by orion · 14 comments
Collaborator

Context

Tasks shown as DAP threads, and a worker pool the debugger can hold (section 14).

Source

Acceptance criteria

  • Each task is a thread in DAP
  • Pausing holds every worker
  • A session in tests/debug/

Steps (epic: no ready on this issue)

  • 1. List suspended tasks as DAP threads - #403 (PR #404)
  • 2a. A debugged thread's position on its interpreter, not on the shared Debugger - #586 (PR #603)
  • 2b. The worker pool the debugger can hold: the kernel's hold and release in runtime/task.c, workersFor giving each worker an interpreter with a thread record, the stop-the-world handshake, a session in tests/debug/ with more than one worker, and the decision of DEBUGGER.md section 14 updated (DEBUGGER.md section 20 lists it as open)

Dependencies

None known.

Moved from the planning lists of the docs; the design record stays the specification.

## Context Tasks shown as DAP threads, and a worker pool the debugger can hold (section 14). ## Source - [DEBUGGER.md section 20](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/DEBUGGER.md#L413) ## Acceptance criteria - [x] Each task is a thread in DAP - [ ] Pausing holds every worker - [ ] A session in `tests/debug/` ## Steps (epic: no `ready` on this issue) - [x] 1. List suspended tasks as DAP threads - #403 (PR #404) - [x] 2a. A debugged thread's position on its interpreter, not on the shared `Debugger` - #586 (PR #603) - [ ] 2b. The worker pool the debugger can hold: the kernel's hold and release in `runtime/task.c`, `workersFor` giving each worker an interpreter with a thread record, the stop-the-world handshake, a session in `tests/debug/` with more than one worker, and the decision of DEBUGGER.md section 14 updated (DEBUGGER.md section 20 lists it as open) ## Dependencies None known. _Moved from the planning lists of the docs; the design record stays the specification._
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop). Implements DEBUGGER.md section 20 / section 14 (tasks as DAP threads, pausing holds every worker); the design record is the specification, no collision with CONCEPT "Open Questions". Touches the debugger and the VM/runtime task pool (opus/high when implemented); likely overlaps the concurrency work, ordering settled in refine. next: refine (queued)

[loop:torbscript] intake: in scope (author orion, label loop). Implements DEBUGGER.md section 20 / section 14 (tasks as DAP threads, pausing holds every worker); the design record is the specification, no collision with CONCEPT "Open Questions". Touches the debugger and the VM/runtime task pool (opus/high when implemented); likely overlaps the concurrency work, ordering settled in refine. next: refine (queued)
Author
Collaborator

[loop:torbscript] refine: still queued behind the intake order. next: waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z

[loop:torbscript] refine: still queued behind the intake order. next: waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T01:57:13Z

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T01:57:13Z
Author
Collaborator

[loop:torbscript] decided by the loop: #41 is an epic of two steps, and step 1 is filed as #403. Why: the design record (DEBUGGER.md section 14) names two separate pieces of work. (1) Listing suspended tasks needs a read-only walk of the scheduler's queues, which the runtime does not offer (runtime/task.c has per-worker queues and a timer heap, no public enumeration), plus per-task stackTrace in compiler/src/debugger. (2) Holding a worker pool needs workersFor (compiler/src/vm/interpret.trb) to give workers interpreters under the debugger and a stop-the-world handshake across threads; that changes the deterministic one-worker guarantee and has its own risks. Together that is more than one PR with one or two commits, and step 2 builds on the task identities of step 1, so splitting is the smaller and safer order. Step 1 first because it delivers 'each task is a thread' on the existing single-worker model and keeps the stop deterministic.

Epic checklist:

  • #403 list suspended tasks as DAP threads (runtime walk, threads, stackTrace per task, session)
  • step 2, filed only when step 1 has landed: a worker pool the debugger can hold (workers get interpreters under the debugger; pause and breakpoints hold every worker; session with tasks running on more than one worker)

Dependency/ordering: #39 and #40 (also debugger) are being implemented in parallel and touch the same files (compiler/src/debugger/debuggee.trb, adapter.trb, tests/debug/, DEBUGGER.md section 20). Step 1 should start after they are merged or in review. Seed: neither step changes syntax, a std name looked up by string or a driver flag; a new debug native is internal.

[loop:torbscript] decided by the loop: #41 is an epic of two steps, and step 1 is filed as #403. Why: the design record (DEBUGGER.md section 14) names two separate pieces of work. (1) Listing suspended tasks needs a read-only walk of the scheduler's queues, which the runtime does not offer (runtime/task.c has per-worker queues and a timer heap, no public enumeration), plus per-task stackTrace in compiler/src/debugger. (2) Holding a worker pool needs `workersFor` (compiler/src/vm/interpret.trb) to give workers interpreters under the debugger and a stop-the-world handshake across threads; that changes the deterministic one-worker guarantee and has its own risks. Together that is more than one PR with one or two commits, and step 2 builds on the task identities of step 1, so splitting is the smaller and safer order. Step 1 first because it delivers 'each task is a thread' on the existing single-worker model and keeps the stop deterministic. Epic checklist: - [ ] #403 list suspended tasks as DAP threads (runtime walk, threads, stackTrace per task, session) - [ ] step 2, filed only when step 1 has landed: a worker pool the debugger can hold (workers get interpreters under the debugger; pause and breakpoints hold every worker; session with tasks running on more than one worker) Dependency/ordering: #39 and #40 (also debugger) are being implemented in parallel and touch the same files (`compiler/src/debugger/debuggee.trb`, `adapter.trb`, `tests/debug/`, DEBUGGER.md section 20). Step 1 should start after they are merged or in review. Seed: neither step changes syntax, a std name looked up by string or a driver flag; a new debug native is internal.
Author
Collaborator

[loop:torbscript] refine: ready (as the epic of two steps). Goal, acceptance criteria, design record point (DEBUGGER.md sections 14 and 20), seed statement and size are in the decision comment above and in the step issue; the epic stays open until step 2 is filed and lands. Worker usage: ~85k tokens (sonnet). Releases claim refine by session:loop-torbscript-20261023. next: implement (step 1, after #39 and #40)

[loop:torbscript] refine: ready (as the epic of two steps). Goal, acceptance criteria, design record point (DEBUGGER.md sections 14 and 20), seed statement and size are in the decision comment above and in the step issue; the epic stays open until step 2 is filed and lands. Worker usage: ~85k tokens (sonnet). Releases claim refine by session:loop-torbscript-20261023. next: implement (step 1, after #39 and #40)
Author
Collaborator

[loop:torbscript] refine: note: the ready label sits on #403 (step 1), not on this epic, so the implement stage does not pick up the whole epic. next: waiting (epic; step 1 is #403, step 2 is filed when it lands)

[loop:torbscript] refine: note: the `ready` label sits on #403 (step 1), not on this epic, so the implement stage does not pick up the whole epic. next: waiting (epic; step 1 is #403, step 2 is filed when it lands)
Author
Collaborator

[loop:torbscript] refine: step 1 (#403, PR #404) merged 2026-10-23; step 2 filed as #586 (worker pool the debugger can hold), one step issue at a time, next: waiting (epic; step 2 is #586)

[loop:torbscript] refine: step 1 (#403, PR #404) merged 2026-10-23; step 2 filed as #586 (worker pool the debugger can hold), one step issue at a time, next: waiting (epic; step 2 is #586)
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-29T17:30Z: step 1 (#403) landed, step 2 is #586 (intake done, in refinement). Nothing else to do on the epic.
next: waiting (epic; step 2 is #586)

[loop:torbscript] refine: re-checked 2026-10-29T17:30Z: step 1 (#403) landed, step 2 is #586 (intake done, in refinement). Nothing else to do on the epic. next: waiting (epic; step 2 is #586)
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-29T19:56Z: step 2 (#586) has its implementation PR #603 open, CI pending. Nothing to do on the epic.
next: waiting (epic; step 2 is #586, PR #603)

[loop:torbscript] refine: re-checked 2026-10-29T19:56Z: step 2 (#586) has its implementation PR #603 open, CI pending. Nothing to do on the epic. next: waiting (epic; step 2 is #586, PR #603)
Author
Collaborator

[loop:torbscript] re-sweep: wrote the steps into the body and ticked "each task is a thread in DAP" (#403). Recovered step 2b: #586 was cut down to moving the thread position per interpreter, and its decision comment said the handshake half "is the next issue, filed when this lands". #586 landed on 2026-10-29 and that issue was never filed; DEBUGGER.md section 20 still lists it as open.

[loop:torbscript] re-sweep: wrote the steps into the body and ticked "each task is a thread in DAP" (#403). Recovered step 2b: #586 was cut down to moving the thread position per interpreter, and its decision comment said the handshake half "is the next issue, filed when this lands". #586 landed on 2026-10-29 and that issue was never filed; DEBUGGER.md section 20 still lists it as open.
Author
Collaborator

[loop:torbscript] refine: step 2a (#586) landed; the remaining step 2b was never filed, so it is now #719 (hold and release the workers, stop-the-world handshake), label loop, refine next. The step list in the body is unchanged (2b links to #719 once it is ready).
next: waiting (epic; step 2b is #719)

[loop:torbscript] refine: step 2a (#586) landed; the remaining step 2b was never filed, so it is now #719 (hold and release the workers, stop-the-world handshake), label loop, refine next. The step list in the body is unchanged (2b links to #719 once it is ready). next: waiting (epic; step 2b is #719)
Author
Collaborator

[loop:torbscript] refine: epic #41 has one open step left, 2b, filed as #719 (PR #722 for its first half is open). Nothing to do on the epic itself.
next: waiting (step 2b #719, PR #722 in review)

[loop:torbscript] refine: epic #41 has one open step left, 2b, filed as #719 (PR #722 for its first half is open). Nothing to do on the epic itself. next: waiting (step 2b #719, PR #722 in review)
Author
Collaborator

[loop:torbscript] re-sweep: step 2b runtime half landed (PR #722, merged 2026-11-12); the VM half (workers under the debugger) is #719, implementation worker running. next: waiting (#719 VM half in implementation)

[loop:torbscript] re-sweep: step 2b runtime half landed (PR #722, merged 2026-11-12); the VM half (workers under the debugger) is #719, implementation worker running. next: waiting (#719 VM half in implementation)
Author
Collaborator

[loop:torbscript] parked: the epic has no work of its own. Its only open step 2b is #719 (VM half of the debugger worker pool), which has a live implementation worker, and the epic was deferred four times with nothing to decide. Parked with label status/parked instead of deferred again. Resume: when the PR for #719 merges, tick step 2b and close the epic if its acceptance criteria hold. next: parked (until #719 merges)

[loop:torbscript] parked: the epic has no work of its own. Its only open step 2b is #719 (VM half of the debugger worker pool), which has a live implementation worker, and the epic was deferred four times with nothing to decide. Parked with label status/parked instead of deferred again. Resume: when the PR for #719 merges, tick step 2b and close the epic if its acceptance criteria hold. next: parked (until #719 merges)
Sign in to join this conversation.
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#41
No description provided.