From cfd2b993feda1b3f7474225bb32db8cac8edc5ae Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 11:21:15 -0300 Subject: targets: the ESP32-P4 board port goes (src/esp32p4*.zig and src/esp32p4/, -Dplatform=esp32p4 with its pinned riscv32 target, -Desp32p4-cols and -rows, the Peek, Poke, Hexdump and Gpio words and the Board behind them, the board's 9P engine options, the gpio_toggle host slot), and with it every guard and limit only the board needed: terminal_panes and terminal.enabled (ghostty is in every build), memory.limits' board branching (the desktop values stay), MAX_PANES 64 and MAX_COLS 16 fixed, the board's boot buffer and its embedded boot, the pager's and the terminal's emulator-less paths; tests: the board's GPIO, ring and Board ones go, the boot-OOM and transition-grid ones stay under their own names; the perf harness loses the board's fixture, so the Debug baselines of both frontends are recorded again (--only medium --reps 10) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- docs/typ/building.typ | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'docs/typ/building.typ') diff --git a/docs/typ/building.typ b/docs/typ/building.typ index b4d7cb82..da704fe8 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -20,7 +20,6 @@ builds MuPDF and is on by default (`-Dmupdf=false` drops it). [`zig build -Dplatform=gui`], [the SDL3 window alone], [`zig build web -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=`], [a freestanding wasm core plus vanilla JavaScript (`docs/web.md`)], [`zig build -Dplatform=macos`], [an AppKit and CoreText app over a static `libpardes.a` (`docs/macos.md`)], - [`zig build -Dplatform=esp32p4`], [a freestanding riscv32 editor object for the ESP32-P4, with a 384 KiB heap], ) A bare `zig build` installs into the prefix (`zig-out`, or `--prefix @@ -33,26 +32,20 @@ without installing. `pardes --version` prints `pardes ` (from install, and on a second line the build's semantics hash, which a replica must share with its session; `pardes --help` lists every flag. -The ESP32-P4 firmware is linked in the sibling `../05-zig-p4` toolchain, -which needs ESP-IDF register headers: after building the editor object -here, `zig build -Dpardes` there links `src/esp32p4/app.zig`. The separate -GPIO 9P image is `zig build -Dapp=../02-pardes-code/src/esp32p4_9p.zig` -there; its namespace is in `src/esp32p4_gpio.zig`. - == Build options `zig build --help` lists the options for the selected platform. #pairs( - [`-Dplatform`], [`tui`, `gui`, `web`, `macos`, `esp32p4`; absent: the tui and SDL shells together, installed into `~/.local`], + [`-Dplatform`], [`tui`, `gui`, `web`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`], [`-Dstatic`], [bool, `false`], - [`-Dmupdf`], [bool; on natively, off for web and esp32p4], + [`-Dmupdf`], [bool; on natively, off for web], [`-Djpx`], [bool, `true`: JPEG 2000, and with it scanned PDFs], - [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full` natively, `zig` for web, `disabled` for esp32p4], + [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full` natively, `zig` for web], [`-Dembed-sources`], [bool, `false`: serve the sources under #file("/src")], [`-Dhome-install`], [bool: a bare `zig build` also copies the binaries into `~/.local/bin`; default true], [`-Dstamp-commit`], [bool: the git commit in `--version` and crash records; on for release builds and the `~/.local` install], - [`-Dtheme-animation`], [bool; on except for esp32p4], + [`-Dtheme-animation`], [bool, `true`], [`-Dworkspace-tag`], [bool: draw the workspace tag row; on except for macOS, whose menu bar carries it], [`-Dprebuilt-shaders`], [bool: embed the committed SPIR-V; on for a bare `zig build`, off with `-Dplatform`; `zig build shaders` refreshes it with glslc], [`-Dtracy`], [path to a Tracy checkout; off], @@ -61,7 +54,6 @@ there; its namespace is in `src/esp32p4_gpio.zig`. [`-Dtest-filter`], [run only tests whose name contains it; a filter that matches nothing fails], [`-Dtest-rebuild`], [bool: fresh Zig test compilation], [`-Dhelix-harness`], [reference executable for live differential tests; `HX_HARNESS`, else `hx-harness` on `PATH`], - [`-Desp32p4-cols`, `-Desp32p4-rows`], [the ESP32-P4's grid, 56 by 14], ) = Tests @@ -142,7 +134,7 @@ Mail patches to the list `~gbrls/inbox@lists.sr.ht`; it is the preferred way to = The core and its shells -One core, five shells (tui, gui, web, macos, esp32p4). The core owns +One core, four shells (tui, gui, web, macos). The core owns editing, layout, rendering and the virtual filesystem it serves over 9P; a shell turns native input into `pardes.Event`, presents `pardes.Surface`, and performs host effects such as spawning processes. @@ -163,13 +155,13 @@ effects such as spawning processes. - `host_io.Host` is a context pointer and a vtable of optional callbacks; a null method is not an error, and `Host{}` is a complete in-process pardes that the tests use. Comptime decides what a build has (`pardes.platform`, - `hosted`, `can_attach`, `terminal_panes`, `pdf_enabled`); the vtable + `hosted`, `can_attach`, `pdf_enabled`); the vtable decides who serves it. - The root module is chosen by platform: `main.zig` (tui, gui), - `web.zig`, `macos.zig`, `esp32p4.zig`. The web and macOS shells are + `web.zig`, `macos.zig`. The web and macOS shells are libraries whose host owns `main()`. -- `memory.limits` is the one home for capacities that differ on the ESP32-P4 - (panes 16, columns 6, selections 64, the tag's 512 bytes). Each core +- `memory.limits` is the one home for the core's capacities (selections, + the tag's bytes, undo, the arenas' regions). Each core allocator is a thread-safe stack-fallback allocator, under a DebugAllocator in Debug builds. @@ -196,7 +188,7 @@ selection-pipe workers post completions through a bounded mailbox; a `host_io.Lsp.Job` owns copies of the source, path and arguments, never reading the live core, and a request id, the pane's serial and (for an edit) the file's revision reject a stale reply. A process that never calls -`turn.start` (the tests, the ESP32-P4, the browser) has no second thread. +`turn.start` (the tests, the browser) has no second thread. == The daemon and detached sessions @@ -264,9 +256,8 @@ shared code. calls. The control tree in `src/ninep/` is its backend: `tree.zig` (nodes, dispatch), `pane.zig`, `ctl.zig`, `cols.zig`, `addr.zig`, `pty.zig`, `events.zig` (event and log), `screen.zig`, `sources.zig`. - `src/9p.zig` names the editor's and the ESP32-P4's engine settings: msize - 65536, 256 fids, 128 held reads a connection, names up to 255 bytes; the - ESP32-P4 has 32 fids. + `src/9p.zig` names the editor's engine settings: msize 65536, 256 fids, + 128 held reads a connection, names up to 255 bytes. - A read, write, open, clunk, remove or truncating wstat can park; a walk, attach, stat, create or rename cannot. Every Rread is clamped to the count and the msize; Tflush answers the original request first. -- cgit v1.3