Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
38d1d81
bool: VAL_BOOL, slot bridges, bool-producing comparisons (#1637 item 1)
xxxxxxxxxxxxx Oct 6, 2026
d3485b1
bool: true/false keywords, AST_BOOL, OP_TRUE/OP_FALSE (#1637 item 2)
xxxxxxxxxxxxx Oct 6, 2026
35335fa
bool: JIT comparison/NOT/JUMP_IF bool paths (#1637 item 3)
xxxxxxxxxxxxx Oct 6, 2026
7393ecc
bool: predicate builtins, lib predicates, JSON/store/db bools (#1637 …
xxxxxxxxxxxxx Oct 6, 2026
c28ebc5
bool: trace tape format v6, bool decode, v5 refusal (#1637 item 5)
xxxxxxxxxxxxx Oct 6, 2026
cd254e5
bool: the observer sees bool bindings (#1637 item 6)
xxxxxxxxxxxxx Oct 6, 2026
7b71133
bool: migrate the repo's 1/0 predicate checks (#1637 item 7)
xxxxxxxxxxxxx Oct 6, 2026
5df0b99
freestanding smoke: observer predicate prints true (#1637)
xxxxxxxxxxxxx Oct 6, 2026
66b3fac
bool: membership raises on bool vs num like == (#1637 round 2, item 1)
xxxxxxxxxxxxx Oct 6, 2026
02b1aca
bool: numeric builtins refuse a bool in every strict mode (#1637 roun…
xxxxxxxxxxxxx Oct 6, 2026
079dc8e
bool: geometry.point_in_polygon returns a bool; measure every lib pre…
xxxxxxxxxxxxx Oct 6, 2026
79efef0
bool: eigen_run's observer predicates answer bools, matching the VM (…
xxxxxxxxxxxxx Oct 6, 2026
af31131
bool: replay refuses a recorded value of the wrong kind (#1637 round …
xxxxxxxxxxxxx Oct 6, 2026
b1d7573
bool: pin ordering, re-audit extension-only 1/0 checks (#1637 round 2…
xxxxxxxxxxxxx Oct 6, 2026
79e800a
changes: note membership, strict=0 and tape v6 in the #1637 fragment
xxxxxxxxxxxxx Oct 6, 2026
39537e7
bool: one checked number read, a builtin-call bool gate, and a gate o…
xxxxxxxxxxxxx Oct 6, 2026
9375b1f
bool: fuzz true and false into every builtin slot and VM operand (#16…
xxxxxxxxxxxxx Oct 6, 2026
f24aa32
bool: one return-kind table for every taped builtin, host names decla…
xxxxxxxxxxxxx Oct 6, 2026
18eb24d
bool: state the exact bool rule and deep =='s short-circuit (#1637 ro…
xxxxxxxxxxxxx Oct 6, 2026
69b6a6e
bool: retire the round-2 Python probes for bash + EigenScript (#1637 …
xxxxxxxxxxxxx Oct 6, 2026
8532f2b
bool: test_replay's dict/nested tapes ride a list-returning builtin (…
xxxxxxxxxxxxx Oct 6, 2026
3414bfc
bool: renamed number members, one raw token, a token-exact gate (#163…
xxxxxxxxxxxxx Oct 6, 2026
a86f9ad
bool: fuzz a bool at depth 1, 2 and 3 of every list argument (#1637 r…
xxxxxxxxxxxxx Oct 6, 2026
e6435a7
bool: build the bool-gate registry lazily, on the first bool (#1637 r…
xxxxxxxxxxxxx Oct 6, 2026
ab6ec18
changes: list #1637's non-bool behaviour changes in the breaking frag…
xxxxxxxxxxxxx Oct 6, 2026
a184134
bool: trace.h's own EigsSlot definition renames d -> d_ too (#1637 ro…
xxxxxxxxxxxxx Oct 6, 2026
34a995b
bool: lib code that CONSUMES bools stops comparing them with 0/1 (#16…
xxxxxxxxxxxxx Oct 6, 2026
5d7931a
bool: json_build writes a bool as a JSON boolean (#1637 round 5, item 2)
xxxxxxxxxxxxx Oct 6, 2026
7266bb3
bool: `what is` a bool answers the bool, not 0 (#1637 round 5, item 3)
xxxxxxxxxxxxx Oct 6, 2026
0333f82
bool: tensor mutators raise on any non-number cell or row, stated exa…
xxxxxxxxxxxxx Oct 6, 2026
7ecc699
bool: EIGS_STRICT=0 keeps str_from_bytes' documented legacy truncatio…
xxxxxxxxxxxxx Oct 6, 2026
af70f20
bool: a [] param_count placeholder is 0 again; only a bool is refused…
xxxxxxxxxxxxx Oct 6, 2026
7c0a513
changes: param_count placeholder keeps its 0 in the #1637 fragment (r…
xxxxxxxxxxxxx Oct 6, 2026
2eb3cdf
bool: `report` takes a bool on the bytecode path too (#1637 round 5, …
xxxxxxxxxxxxx Oct 6, 2026
ce4583e
bool: db parameters bind a bool as an SQL boolean (#1637 round 5, ite…
xxxxxxxxxxxxx Oct 6, 2026
a4a89f6
changes: db bool params, json_build bools and `what is` a bool in the…
xxxxxxxxxxxxx Oct 6, 2026
948fd2b
bool: eigs_value_as_num answers NaN for a bool; host_add checks types…
xxxxxxxxxxxxx Oct 6, 2026
974c7d1
codspeed: pin DMG at afd9bd5 (DMG#79), which is ready for the boolean…
xxxxxxxxxxxxx Oct 6, 2026
a8979e0
bool: test and document the round-5 UI helpers _ev_flag/_ev_stop (#16…
xxxxxxxxxxxxx Oct 6, 2026
4c7941d
perf: the bool gate resolves ~30 policy rows instead of building a so…
xxxxxxxxxxxxx Oct 6, 2026
dab6454
bool: model builtins refuse a nested bool before the no-model answer;…
xxxxxxxxxxxxx Oct 6, 2026
7313879
bool: test_db's DB17 message and a live bool-parameter round trip (#1…
xxxxxxxxxxxxx Oct 6, 2026
e54cf27
bool: the model capability probes expect eigen_model_loaded's bool (#…
xxxxxxxxxxxxx Oct 6, 2026
c00e91d
bool: ui_sdl_input compares gfx_open and event modifiers as bools (#1…
xxxxxxxxxxxxx Oct 6, 2026
0354e24
bool: an any-value row for an extension this build lacks is not stale…
xxxxxxxxxxxxx Oct 6, 2026
ea7158b
strict shape cases: gfx_open / audio_music_play valid results are boo…
xxxxxxxxxxxxx Oct 6, 2026
27ec923
strict shape cases: backend-absent outputs print false for gfx_open /…
xxxxxxxxxxxxx Oct 6, 2026
ada801a
bool: the fuzz and lib-predicate probes run without the ulimit -v cap…
xxxxxxxxxxxxx Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# Shallow fetch of one commit; `git clone` of a branch is not a pin.
- name: Fetch consumer DMG at its pin
env:
DMG_REF: cf6ef5e151deff98cc29250a7c8fc394ee4b64d6 # DMG master, 2026-09-21
DMG_REF: afd9bd52778cb0a8d1ab0473ec726aaae556fb90 # DMG master, 2026-10-06 (DMG#79: ready for the boolean type, #1637)
run: |
set -euo pipefail
mkdir -p .codspeed-consumers/DMG && cd .codspeed-consumers/DMG
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ define AUX_REFRESH
done
endef

.PHONY: all build server server-db full http net gfx zlib lib amalgamation tsan test test-changed precheck sandbox-intern-test install install-gfx clean coverage coverage-clean fuzz fuzz-run lsp lsp-asan dap jit-smoke embed-smoke embed-smoke-asan embed-smoke-asan-server embed-smoke-gfx embed-concurrent asan asan-server valgrind pgo poison freestanding-check freestanding-libc-diff asan-http asan-gfx tsan-server tsan-http nativefn-test arming-mt-test embed-roads print-% sigpipe-contract-test sigpipe-partial-test ui-sdl-input-gfx
.PHONY: db-params-test all build server server-db full http net gfx zlib lib amalgamation tsan test test-changed precheck sandbox-intern-test install install-gfx clean coverage coverage-clean fuzz fuzz-run lsp lsp-asan dap jit-smoke embed-smoke embed-smoke-asan embed-smoke-asan-server embed-smoke-gfx embed-concurrent asan asan-server valgrind pgo poison freestanding-check freestanding-libc-diff asan-http asan-gfx tsan-server tsan-http nativefn-test arming-mt-test embed-roads print-% sigpipe-contract-test sigpipe-partial-test ui-sdl-input-gfx

# ---- Per-variant objdir engine (#740) -------------------------------------
# The engine's rules are defined before `all`, so pin the default goal.
Expand Down Expand Up @@ -298,6 +298,16 @@ build/$(TRACE_CORRESPONDENCE_VARIANT)/test_trace_correspondence: tests/test_trac
trace-correspondence-test: build/$(TRACE_CORRESPONDENCE_VARIANT)/test_trace_correspondence
@echo "Trace correspondence test built: $<"

# #1637: db parameter binding without a PostgreSQL server -- the test
# includes src/ext_db.c (static db_build_query) and links the server-db
# variant's other objects.
DB_PARAMS_OBJ := $(filter-out build/server-db/main.o build/server-db/ext_db.o,$(OBJ_server-db))
build/server-db/test_db_params: tests/test_db_params.c $(SRC_DIR)/ext_db.c $(DB_PARAMS_OBJ) $(wildcard $(SRC_DIR)/*.h) Makefile tools/werror_flags.txt
$(CC) $(FLAGS_server-db) -I$(SRC_DIR) -o $@ $< $(DB_PARAMS_OBJ) $(LIBS_server-db)
.PHONY: db-params-test
db-params-test: build/server-db/test_db_params
@echo "DB params test built: $<"

TRACE_CONTEXT_VARIANT ?= release
TRACE_CONTEXT_OBJ := $(filter-out build/$(TRACE_CONTEXT_VARIANT)/main.o,$(OBJ_$(TRACE_CONTEXT_VARIANT)))
build/$(TRACE_CONTEXT_VARIANT)/test_trace_context: tests/test_trace_context.c $(TRACE_CONTEXT_OBJ) $(wildcard $(SRC_DIR)/*.h) Makefile tools/werror_flags.txt
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ blocked concurrency calls wake, and the process exits with status `N` after
worker teardown. Native I/O must return before teardown completes. Embedded
evaluations have separate stop scopes (see `docs/EMBEDDING.md`).

`vm_run_bytecode` raises a catchable `value` error naming a rejected chunk descriptor; a valid program may still return `null`. `sandbox_run` reports descriptor rejection in its structured `{ok: 0, error: ...}` result. Its optional fourth limit, `max_work`, bounds cumulative bytecode instructions across function calls and callback re-entry (default 10,000,000), independently of loop and allocation limits. This meters VM work, not elapsed time: a blocking native callback must return before the sandbox can stop.
`vm_run_bytecode` raises a catchable `value` error naming a rejected chunk descriptor; a valid program may still return `null`. `sandbox_run` reports descriptor rejection in its structured `{ok: false, error: ...}` result. Its optional fourth limit, `max_work`, bounds cumulative bytecode instructions across function calls and callback re-entry (default 10,000,000), independently of loop and allocation limits. This meters VM work, not elapsed time: a blocking native callback must return before the sandbox can stop.

Sandbox execution does not update shared temporal history: assignment values, names, counts and observer snapshots stay outside that history even when recording is armed. Ordinary tape assignment records still emit. Host and trusted descriptor history recording resumes normally outside the sandbox; sandbox temporal reads remain refused.

Expand Down Expand Up @@ -155,6 +155,10 @@ Alice
Error: {"kind": "undefined_name", "message": "undefined variable 'risky_operation'", "line": 41}
```

Comparisons, `not` and predicates return `true`/`false`, a `bool`. A bool is
not a number: `true + 1` and `(x > 0) == 1` raise, so test a bool directly
(`if x > 0:`). See [docs/SPEC.md](docs/SPEC.md#booleans-comparison-and-logic).

### Ask Your Code

Every value quietly remembers how it has been changing — and you don't pay
Expand Down
42 changes: 42 additions & 0 deletions changes/breaking/1637-boolean-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
- **A distinct `bool` type (#1637).** Comparisons and `not` return `true`/`false` of type `bool`
instead of the numbers `1`/`0`. Truthiness is unchanged (`false` is falsy, `true` truthy).
Arithmetic on a bool raises, and so does `==`/`!=` between a bool and a number: migrate
`(pred of x) == 1` to `if pred of x:` or `== true`.
`list_contains`/`list_index_of` raise on bool vs number the same way. Any
builtin given a bool where it does not take one raises, even under
`EIGS_STRICT=0`: as its argument, at a position of its argument list, or
as an element of a list it reads as numbers. The slots that take a bool are
listed in `tests/bool_fuzz_anyvalue.txt`. A bool slice bound, index, `range`
bound or `at` line raises. Deep `==` stops at the first unequal pair, and a
bool/number pair raises when the walk reaches it. Trace tapes are format v6;
a v5 tape is refused, and so is a record of a kind its builtin cannot
return. Embedding hosts declare a recorded name's kinds with
`eigs_trace_declare_kind`. `db_execute`/`db_query_value`/`db_query_json` take a bool
parameter and bind it as an SQL boolean, so a bool read from a boolean
column can be written back. `json_build` writes a bool value as JSON
`true`/`false`, and `what is` a bool answers the bool. The embedding API's
`eigs_value_as_num` answers NaN for a bool (0.0 for any other non-number).
- **Wrong-typed numbers that used to be read as garbage now raise (#1637).** The
bool work routed every C number read through a checking accessor, which
also changes some non-bool cases:
- a string `at` line (`what is x at "s"`) raises; it answered null;
- a non-number net timeout (`net_accept`/`net_dial`/`net_recv`), a
non-number `http_serve` port, and a non-number code byte in a
`vm_run_bytecode`/`sandbox_run` descriptor raise; they were read as
garbage or as 0 (a non-number `param_count` placeholder such as `[]`
still means 0 parameters; only a bool there raises);
- the tensor mutators `numerical_grad*`/`sgd_update*` raise on a non-number
cell or row in every strict mode, `EIGS_STRICT=0` included: v0.44.0 read
a non-number cell as 0 (and `numerical_grad_rows`/`_cols` wrote into it
in place) and skipped a null row;
- a non-number `screen_put` color and a non-number, non-bool
`write_bytes` append flag raise in every strict mode (neither had a
documented `EIGS_STRICT=0` answer);
- a non-number cell `gather` selects raises under `EIGS_STRICT` (it was
0); `EIGS_STRICT=0` keeps the 0.
`EIGS_STRICT=0` keeps every answer it documents for non-bool values:
`str_from_bytes`, `inflate`/`deflate` and the other byte-list builtins
still read a non-number element as 0 there (a bool raises in every mode).
Embedders that include `eigenscript.h`: a Value's number is `VAL_NUM_RAW(v)`
and a slot's is `SLOT_NUM_RAW(s)` (the members were renamed so an unchecked
read does not compile).
Loading
Loading