diff options
| author | 2026-10-14 07:55:08 +0000 | |
|---|---|---|
| committer | 2026-10-14 07:55:08 +0000 | |
| commit | d8da21a406f449d277c42b91d4c9bf8b20bd0dcc (patch) | |
| tree | 79a4dbf6839eaee19aa626f1aa3981d5b0c19377 /docs/design | |
| parent | build: embed images with #embed, keep everything generated in build/ (diff) | |
embed: tests, editor support and docs; js vm file access; test fixes
embed declarations get accept and reject fixtures, a run-only image check
through zc0, an lsp keyword hover and the grammar keyword. errors point at
the declaration and still declare the name, so its uses are not reported
again. zc0 tracks byte-string globals and lays embedded arrays out one word
per element, the way its own indexing reads them.
the command-line javascript vm reaches node's file system for the file
syscalls, so include and embed work there; other embedders opt in.
the web build is self-contained in build/web with its examples. README,
BORROW and BOOTSTRAP-OWNERSHIP describe the new build and ownership rules,
and ONBOARD.md is a reading and verification order for the code.
the suite passes the map header to mklayout, the wasm fuzz program uses
the include format, and lsp drivers scale their deadlines on hosts
without the arm64 jit (ZC_TEST_TIMEOUT_SCALE). LLVM_CONFIG selects an
llvm with headers for the llvm section.
Diffstat (limited to 'docs/design')
| -rw-r--r-- | docs/design/memory.md | 10 | ||||
| -rw-r--r-- | docs/design/storage-analysis.md | 2 | ||||
| -rw-r--r-- | docs/design/test-coverage.md | 82 |
3 files changed, 47 insertions, 47 deletions
diff --git a/docs/design/memory.md b/docs/design/memory.md index c282df5..8875c72 100644 --- a/docs/design/memory.md +++ b/docs/design/memory.md @@ -5,12 +5,12 @@ the compiler, runtime, and host must agree on their addresses. `genmap` writes a matching `memmap.h`, runtime source, and compiler source; `src/tools/automap.sh` builds an image against those files. rebuild the host against the generated headers. changing a header alone does not relocate an existing genome. compact compiler and run-only maps also put their heap above the fixed regions, so compiler storage can grow after startup. ```sh -bin/genmap --preset default --check +build/bin/genmap --preset default --check bash src/tools/automap.sh small build/small -bin/genmap --preset default --code 65536 --symbols 256 --locals 64 --fwd 512 --pool 8192 --hash 1024 -o build/custom +build/bin/genmap --preset default --code 65536 --symbols 256 --locals 64 --fwd 512 --pool 8192 --hash 1024 -o build/custom ``` -run `bin/genmap --help` for the table, heap, genome, and stack options. sizes are in vm words unless an option says otherwise; one word is eight bytes. `--snap-cap` selects the initial snapshot reservation and `--quote-cap` selects an initial token count, with three words per token. both regions grow after startup. +run `build/bin/genmap --help` for the table, heap, genome, and stack options. sizes are in vm words unless an option says otherwise; one word is eight bytes. `--snap-cap` selects the initial snapshot reservation and `--quote-cap` selects an initial token count, with three words per token. both regions grow after startup. ## layout inventory @@ -79,8 +79,8 @@ the stub and board ports reserve `MICRO_PORT_WORDS` cells at build time; it defa the default native map places a growing heap above the fixed regions. hosted runners accept `TINYVM_MEMORY_WORDS` for initial memory and `TINYVM_MAX_MEMORY_WORDS` for its growth limit. javascript also accepts `memoryWords` and `maxMemoryWords` when constructing a vm. invalid configurations are rejected before execution. ```sh -TINYVM_MAX_MEMORY_WORDS=16777216 bin/zy < examples/hello.zc -TINYVM_MEMORY_WORDS=4194304 bin/zym < examples/hello.zc +TINYVM_MAX_MEMORY_WORDS=16777216 build/bin/zy < examples/hello.zc +TINYVM_MEMORY_WORDS=4194304 build/bin/zym < examples/hello.zc ``` the native core reserves a stable backing allocation up to its startup maximum; increasing the available size keeps addresses and native code pointers valid. the microcore and javascript vm replace backing allocations when they grow, preserving existing contents. native bounds use the reservation; portable bounds use the current allocation. memory syscall `9` with argument `4` requests growth, and argument `5` changes the growth limit during execution. a limit cannot fall below the current size. the native limit cannot exceed its startup reservation. diff --git a/docs/design/storage-analysis.md b/docs/design/storage-analysis.md index cff713a..432139a 100644 --- a/docs/design/storage-analysis.md +++ b/docs/design/storage-analysis.md @@ -30,4 +30,4 @@ facts are copied into each reference's editor record while the compiler parses i ## focused checks -`node tests/drivers/storage_analysis_test.js bin/zclsp` checks known bounds, packed elements, direct aliases, free and scope lifetimes, hover metadata, and safe or uncertain neighboring cases. +`node tests/drivers/storage_analysis_test.js build/bin/zclsp` checks known bounds, packed elements, direct aliases, free and scope lifetimes, hover metadata, and safe or uncertain neighboring cases. diff --git a/docs/design/test-coverage.md b/docs/design/test-coverage.md index fae9356..e916df4 100644 --- a/docs/design/test-coverage.md +++ b/docs/design/test-coverage.md @@ -35,7 +35,7 @@ the `qualifiers` group in `toolchain_lsp_contract_test.js` checks both qualifier ## public standard-library documentation -`src/lib/std.zc` documents public operations for output capture, numeric helpers, packed byte strings, host access, arenas, growable byte buffers, and array algorithms, including parameter and return behavior. the array algorithms document their callback roles, result types, traversal order, and reference sharing. `src/tools/embed.sh all --check` verifies that the compiler's embedded source matches the module. `hover_surface_test.js` and `hover_features_test.js` check selected embedded library documentation; they do not assert that every public function has a description. edge-case behavior for the broader standard-library API still needs dedicated acceptance tests. +`src/lib/std.zc` documents public operations for output capture, numeric helpers, packed byte strings, host access, arenas, growable byte buffers, and array algorithms, including parameter and return behavior. the array algorithms document their callback roles, result types, traversal order, and reference sharing. the compiler carries the module through an `embed` declaration, so its embedded text is the module file as of the build. `hover_surface_test.js` and `hover_features_test.js` check selected embedded library documentation; they do not assert that every public function has a description. edge-case behavior for the broader standard-library API still needs dedicated acceptance tests. ## unused-argument hints @@ -69,53 +69,53 @@ the formatter indents case labels one level inside their switch by default (`Cas ## focused commands -run from the repository root. native binaries and the language server must already be built; the wasm command needs a built `src/web/zc.wasm`. +run from the repository root. native binaries and the language server must already be built; the wasm command needs a built `build/web/zc.wasm` (`make web`). ```sh -python3 tests/drivers/fuzz_compiler.py bin/zy bin/zym --js -python3 tests/drivers/fuzz_malformed.py bin/zy bin/zym -node tests/drivers/fuzz_wasm.js src/web/zc.wasm -python3 tests/drivers/image_growth_test.py bin/zy -python3 tests/drivers/code_emission_growth_test.py bin/zy -python3 tests/drivers/code_address_growth_test.py bin/zy +python3 tests/drivers/fuzz_compiler.py build/bin/zy build/bin/zym --js +python3 tests/drivers/fuzz_malformed.py build/bin/zy build/bin/zym +node tests/drivers/fuzz_wasm.js build/web/zc.wasm +python3 tests/drivers/image_growth_test.py build/bin/zy +python3 tests/drivers/code_emission_growth_test.py build/bin/zy +python3 tests/drivers/code_address_growth_test.py build/bin/zy python3 tests/drivers/seed_growth_test.py python3 tests/drivers/memory_limits_test.py -python3 tests/drivers/stack_growth_test.py bin/zy +python3 tests/drivers/stack_growth_test.py build/bin/zy python3 tests/drivers/layout_config_test.py -python3 tests/drivers/compiler_growth_test.py bin/zy -python3 tests/drivers/parser_growth_test.py bin/zy -node tests/drivers/fuzz_lsp.js bin/zclsp -node tests/drivers/lsp_growth_test.js bin/zclsp -node tests/drivers/protocol_growth_test.js bin/zclsp -node tests/drivers/core_lsp_test.js bin/zclsp -node tests/drivers/hover_values_test.js bin/zclsp -node tests/drivers/hover_features_test.js bin/zclsp -node tests/drivers/hover_surface_test.js bin/zclsp -CONTRACT_GROUP=inference node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=qualifiers node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -python3 tests/drivers/compiler_contract_test.py bin/zy --group qualifiers -python3 tests/drivers/compiler_contract_test.py bin/zym --group qualifiers -python3 tests/drivers/inference_growth_test.py bin/zclsp -node tests/drivers/storage_analysis_test.js bin/zclsp -node tests/drivers/hints_test.js bin/zclsp -node tests/drivers/include_test.js bin/zclsp -CONTRACT_GROUP=quickfix node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=modulehover node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=namespacecompletion node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=navigation node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp +python3 tests/drivers/compiler_growth_test.py build/bin/zy +python3 tests/drivers/parser_growth_test.py build/bin/zy +node tests/drivers/fuzz_lsp.js build/bin/zclsp +node tests/drivers/lsp_growth_test.js build/bin/zclsp +node tests/drivers/protocol_growth_test.js build/bin/zclsp +node tests/drivers/core_lsp_test.js build/bin/zclsp +node tests/drivers/hover_values_test.js build/bin/zclsp +node tests/drivers/hover_features_test.js build/bin/zclsp +node tests/drivers/hover_surface_test.js build/bin/zclsp +CONTRACT_GROUP=inference node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=qualifiers node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +python3 tests/drivers/compiler_contract_test.py build/bin/zy --group qualifiers +python3 tests/drivers/compiler_contract_test.py build/bin/zym --group qualifiers +python3 tests/drivers/inference_growth_test.py build/bin/zclsp +node tests/drivers/storage_analysis_test.js build/bin/zclsp +node tests/drivers/hints_test.js build/bin/zclsp +node tests/drivers/include_test.js build/bin/zclsp +CONTRACT_GROUP=quickfix node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=modulehover node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=namespacecompletion node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=navigation node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp node tests/drivers/codeactions_client_test.js node tests/drivers/ext_cache_test.js -python3 tests/drivers/array_methods_test.py bin/zy -python3 tests/drivers/array_methods_test.py bin/zy --case map -python3 tests/drivers/array_methods_test.py bin/zy --case filter -python3 tests/drivers/array_methods_test.py bin/zy --case search -python3 tests/drivers/array_methods_test.py bin/zy --case reduce +python3 tests/drivers/array_methods_test.py build/bin/zy +python3 tests/drivers/array_methods_test.py build/bin/zy --case map +python3 tests/drivers/array_methods_test.py build/bin/zy --case filter +python3 tests/drivers/array_methods_test.py build/bin/zy --case search +python3 tests/drivers/array_methods_test.py build/bin/zy --case reduce python3 tests/drivers/cli_help_test.py python3 tests/drivers/runtime_image_test.py -CONTRACT_GROUP=magic node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=strings node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=arguments node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -CONTRACT_GROUP=modules node tests/drivers/toolchain_lsp_contract_test.js bin/zclsp -node tests/drivers/nav_test.js bin/zclsp -tests/runerr.sh bin/zy tests/errors +CONTRACT_GROUP=magic node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=strings node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=arguments node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +CONTRACT_GROUP=modules node tests/drivers/toolchain_lsp_contract_test.js build/bin/zclsp +node tests/drivers/nav_test.js build/bin/zclsp +tests/runerr.sh build/bin/zy tests/errors ``` |
