aboutsummaryrefslogtreecommitdiff
path: root/tests/test.sh
Commit message (Collapse)AuthorAgeFilesLines
* js vm: syscall 7 (exit) stops the run with its status, so a runtime fault no ↵Gravatar zinc 12 days1-0/+1
| | | | longer runs on past the fault (js vm trace check)
* hold: copy hold.h with micro.c everywhere; xref baseline for hold globals; ↵Gravatar zinc 12 days1-5/+5
| | | | lsp keyword completion yields to a same-named symbol; compiler message avoids the word actor
* lsp: hold and shared hovers, completion of the keywords, shared variables ↵Gravatar zinc 12 days1-0/+3
| | | | marked in hover and completion; tmLanguage keywords; hold_lsp_test.js
* test.sh: hold fixtures on interp, micro, x86-64 jit and llvmGravatar zinc 12 days1-0/+12
|
* lsp: borrow errors ranged on the use, with related information for where the ↵Gravatar zinc 13 days1-0/+4
| | | | owner ended and was declared; vscode client passes relatedInformation through
* analyzer: check borrow returns of forward-called functions at the unit's ↵Gravatar zinc 13 days1-0/+2
| | | | end; borrows clause for prototypes, definitions, externs and function types, checked against the body
* std: add std.Io (print, println, nl, put_*, put_f, get_c, eof, read, ↵Gravatar zinc 13 days1-0/+1
| | | | getline) with test, learn example and docs
* x86-64 jit: inline new_k, recycle_leaf and own fast paths, in o3 regions and ↵Gravatar zinc 13 days1-1/+5
| | | | | | | | | | | | | | plain blocks a call to rt.new_k / rt.recycle_leaf with a constant class, or to rt.own, does its class-list pop or push (or owner store) inline and goes on after the call; an empty list, memdebug, a held range, a block outside memory, a translated word or a type/class mismatch takes the ordinary call. in a region this replaces the o3_invoke round trip. o3 frees of leaf objects now use recycle_leaf too (new_k stamps the type inside o3 since b86db60). ZYNOFASTALLOC=1 turns it off; ZYPERFMAP=1 writes a perf map of translated code. tests/programs/o3_freelist.zc: reuse, zeroing, an empty list, untyped neighbours, memdebug; jit vs ZYNOFASTALLOC vs ZYO3INTERP.
* prover: len/cross-array/fixed-new/affine proofs; keep facts past call loopsGravatar zinc 13 days1-0/+3
| | | | | | | | Rebased the prover WIP onto main. lafact_keep restores undirtied allocation facts even when the loop body might free (so a later touch() no longer drops every length fact). proven_p uses ptr_still so an outer call keeps the check. entry_fact still supplies the size for the "might free" explain reason. bounds_prover.zc and explain_prover.zc land with test.sh coverage.
* std: File, the first user of drops: std.Host.open(path, mode) returns an ↵Gravatar zinc 13 days1-0/+1
| | | | owned std.File (or null) with write and read, and its drop closes the descriptor; Host.writefile is built on it; file_drop.zc, learn and readme
* destructors: hint: x: has drop and is live at spawn; the worker's copy drops ↵Gravatar zinc 13 days1-0/+1
| | | | it too, on x.spawn() of a mailbox struct for each live owned local with a drop; spec 6.15.4, lsp hint check
* destructors: reassigning an m owner that still holds a value frees the old ↵Gravatar zinc 13 days1-0/+1
| | | | value first, running its drop (right side first, then the free, then the store), with hint: x: reassigning frees the old value; a new value that is part of the old one is an error; u, d and captured owners keep the leak error; the new value's size, leaf type and drop are recorded like a declaration's; spec 6.8.5, 6.15.2
* genmap: default genome reservation 0x70000 words (the genome had 197 words ↵Gravatar zinc 13 days1-1/+1
| | | | left); the map constants in rt.zc and the README table move by 0x8000; gc.zc's reclaim bound is 900 (937 with the heap higher, 952 before) and the run-only section rewrites whatever its number
* test.sh: the small map's collector check rewrites gc.zc's reclaim bound ↵Gravatar zinc 13 days1-1/+1
| | | | whatever its number (it was 990 when the sed was written, gc.zc says 950 now, so the small map was held to the default map's count)
* destructors: heap(v), drop(v, f) / v.drop(f) / v.drop = f, struct drop ↵Gravatar zinc 13 days1-0/+1
| | | | methods, collector drops after the sweep (once, resurrection), freed blocks forget their drop, temporaries drop at statement end with a hint, actor send check; o3: no collection inside a region (pending until the outermost exit), no drops set or ended inside o3; spec 3.11.6, 4.10.3-4, 6.15
* bounds: body scan, loop-entry hoisting, pointer proofs from requested size, ↵Gravatar zinc 13 days1-0/+5
| | | | --explain-checks v1 (non-o3 code)
* zy: nonzero exit on compile errorsGravatar zinc 13 days1-0/+2
|
* rt: exact-size heap bounds; n, the words new asked for, lives in bits 32..62 ↵Gravatar zinc 13 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of p[-4] the bnd recipe and paylen read n instead of the power-of-two block: bnd: r6 = sub p 3; r6 = ld r6; r7 = xor p 0x2B7E1516; r6 = eq r6 r7; r7 = sub p 4; r7 = ld r7; r7 = shr r7 32; r7 = mul r7 q; r8 = mul i m; r8 = ltu r8 r7; r8 = xor r8 1; r0 = and r6 r8 paylen: return p[-4] >> 32 two loads instead of three; osize, bchk, release, recycle and the memdebug leak report all read n (rt.new(4) has length 4, rt.new(0) has 0). writers: new_raw and new_k set n; stack.h line 87 and tinyvm.ts (BigInt) set it on stack segments. release clears n when a block goes into quarantine (len 0, indexing traps; under memdebug bchk reports a use after free); every free-list path (fpush, mkblock, bdrop, recycle_leaf, balloc hold) rewrites the word as k << 16, and an array that grows gets a fresh block. a request over 2^31-1-HDR words stops in new_raw (oom), and the compiler only takes the new_k fast path for constant sizes that fit, so n is never truncated. bit users checked (all mask or preserve bits 32..62; none compares or copies the whole word): gc mark and sweep; release, free, recycle, recycle_leaf; share and own; isobj, quar, checkptr, obj_base; bclass and the bfree buddy merge; balloc, mkblock, fpush, funlink, heap_grow; frame_grow; stack_allocate in src/core/stack.h and src/js/tinyvm.ts; micro.c and core.c (check word only); the compiler's two p[-4] | F_INTERNAL writes (base.zc, builtins.zc). 32-bit ports: none (baremetal, wasm and micro use int64 Cell). tests: tests/programs/exactsize.zc (n-1/n for non-power-of-two sizes, new(0), packed bytes, recycle, grow, stack growth); 8-runtime: exact_size_bounds, pointer_index_n_minus_1, pointer_index_n_traps, pointer_index_n_traps_memdebug, new_zero_index_traps, new_too_big_traps, stale_index_after_free_traps, stale_index_after_free_memdebug. expectations changed: leak report shows n (tests/test.sh line 169, examples/learn/13-memdebug.out, docs/LEARN.md, 4-statements/memdebug_report_line.zc). programs adjusted to keep test.sh expectations: quarantine.zc (unbounded), bounds_heap.zc (rt.new(11)). spec 3.7.4 and 4.11 updated. fixpoint 402204 words (main 402197).
* tests: x86-64 o3 regions compile and match the region interpreterGravatar zinc 13 days1-1/+5
|
* merge work/xref: zc0 u*d redo and follow-upsGravatar zinc 13 days1-0/+1
|\
| * zc0: a store into a local embed array is an error (its elements are in the ↵Gravatar zinc 13 days1-0/+1
| | | | | | | | code); test in tests/test.sh
* | x86-64 jit: inline enhancements (micro-ops lowered to registers, literal ↵Gravatar zinc 13 days1-0/+10
| | | | | | | | specialization, ZYNOENH=1 to call xrun); enh_ops test; jit_x64_test in test.sh
* | test: a constant loop bound drops the fixed-array bounds check (bounds_proof)Gravatar zinc 13 days1-0/+1
|/
* merge bounds checkingGravatar zinc 13 days1-3/+8
|\
| * bounds checking: port agent/bounds-checking onto main 0879d0a; unbounded ↵Gravatar zinc 13 days1-3/+8
| | | | | | | | main in o3call, o3 tests expect no check, boundsrules, bounds_fixed, bounds_heap and zc0unbounded tests
* | merge: memdebug obj_base via size classesGravatar zinc 13 days1-0/+1
|\ \
| * | memdebug: obj_base finds the header from the buddy size classes, not a ↵Gravatar zinc 13 days1-0/+1
| |/ | | | | | | 64-word scan; regression program
* | merge: seven self-hosted compiler fixes from conformanceGravatar zinc 13 days1-4/+7
|\ \ | |/ |/|
| * conformance: b.2.8 is documented behavior; keep the conformance run out of ↵Gravatar zinc 13 days1-4/+7
| | | | | | | | test.sh -q; todo notes for the seven fixes
* | merge main into work/line-tablesGravatar zinc 13 days1-0/+7
|\|
| * merge spec conformance suiteGravatar zinc 13 days1-0/+4
| |\
| | * conformance: port the previous agent's suite, fix six expectations, add ↵Gravatar zinc 13 days1-0/+4
| | | | | | | | | | | | sections 5 to 8 and appendix b, known.txt, zc0 skips, wire into test.sh
| * | xref: checked-in baseline, --check self-test hooked into the lsp section, todoGravatar zinc 13 days1-0/+3
| |/
* / line tables and backtraces: port agent/line-tables onto main, op 56 on the ↵Gravatar zinc 13 days1-8/+16
|/ | | | x86-64 jit, docs, measurements, tests; default genome reservation 0x68000
* Merge the defer statement; todo: tick it, add its follow-upsGravatar zinc 13 days1-0/+1
|\
| * zc: add the defer statementGravatar zinc 13 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | defer expr; and defer { ... } register code that runs when the enclosing block ends: at the end of the block, and at return, break and continue that leave it. the tokens are kept at the defer and compiled again at each exit (block_close, body, kw_return, kw_break, kw_continue), newest first, before the block's variables are released, so the analyzer sees a deferred rt.free(p) as the transfer of p where it runs. names mean what they meant at the defer; values are read when it runs. return, break and continue inside a deferred statement are errors, reported once. works in unchecked code and closures (own base per function context).
* | Merge four small fixes: std hovers, capture terminator, bare static calls, ↵Gravatar zinc 13 days1-0/+5
|\ \ | | | | | | | | | void main; todo updated
| * | fix std hover, full capture terminator, bare static calls, void main in ↵Gravatar zinc 13 days1-0/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | run-only images - hover: a symbol from an embedded library source (tinyvm:std.zc, tinyvm:icon.zc) was looked up only in the document; look it up by its qualified name in the library source (hover_embedded_sym), and render a method found that way by its line (bs_hover). - std.capture: allocate one word more than the 256 it holds, so end() terminates inside the buffer. - a bare call to a static function of the enclosing struct resolves like a bare struct constant (mstruct is set for every non-generic struct's methods); the struct's own wins over a global. - run.zc declares main untyped (fn main();), so a run-only image accepts int, void or untyped main with both compilers.
* | Merge the x86-64 jit, phase 1; todo: tick it, add phase 2Gravatar zinc 13 days1-3/+4
|\ \ | |/ |/|
| * x86-64 jit: zyi target, ZYNOO3, bench and test timeouts, docs; drop a stray fileGravatar zinc 13 days1-3/+4
| |
* | Merge the compiler split into phase filesGravatar zinc 13 days1-4/+8
|\ \ | | | | | | | | | | | | also: ca_owners in the language server keeps the owner order in a fixed array instead of a heap list the analyzer rejected.
| * | split compiler.zc into files by phaseGravatar zinc 13 days1-4/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | src/compiler/compiler.zc is now twelve files under src/compiler/, listed in order in src/compiler/parts. cat of the parts in order is byte-identical to the old file, so every compiler and image except the language server's is unchanged. no function was edited. consumers read the list: the makefile, bootstrap-check, genmap (which still writes one compiler.zc into a generated map directory), tinyvm.bat, test.sh, test_win.ps1 and the lsp drivers. the language server embeds each part and serves them joined as the one document tinyvm:/compiler.zc.
* | Merge branch 'worktree-agent-a0734822346ae18db' into ccr-0054c02e-dfdvndGravatar zinc 13 days1-0/+4
|\ \ | |/ |/|
| * zc0: byte string types, u/m/d as names, enhancements in asmGravatar zinc 13 days1-0/+4
| | | | | | | | | | | | | | | | | | bstr locals, globals, parameters and returns are byte strings for + , the comparisons, indexing, slicing, len and put_s; b"..." globals; embed inside a function. u, m and d are ordinary names: a recast is the letter with the star touching it (u*x), tags .u .m .d are accepted on types and bare. an enhancement named inside asm { } emits its opcode. zc0's image of the genome and language server sources is unchanged.
* | Merge branch 'worktree-agent-a3354164c07827b2e' into ccr-0054c02e-dfdvndGravatar zinc 13 days1-0/+1
|\ \ | |/ |/|
| * add c-style typedef and a built-in string aliasGravatar zinc 13 days1-0/+1
| | | | | | | | | | | | | | | | typedef T name; binds name to the type record of T, at the top level or in a function (scoped to its block). string is a built-in alias for char*. A type name straight before , or ) in a parameter list is the parameter's name, so fn f(string) still works. The language server shows typedef T name; on hover and highlights typedef as a keyword.
* | constants inside structs, and typo suggestions for fields and static membersGravatar zinc 13 days1-0/+1
|/ | | | | | | | const NAME = e; inside a struct body declares a compile-time constant named Struct.NAME, reached as Struct.NAME or by bare name in the struct's methods. A misspelled field or Struct.name member now ends its error with '; did you mean 'name'?' on the member word, which the language server turns into a quick fix.
* todo: one sorted list of open work; library suggestions without naming librariesGravatar zinc 13 days1-0/+2
| | | | | | | | | | | | | | TODO.md ticks the items verified done (namespaces, actor and icon libraries and their coverage, the genome embed, the bootstrap ownership limits, the docs and fixtures sweep) and lists everything still open, including the newly requested language features, sorted easiest first. the compiler no longer names actor: file libraries for suggestions come from src/lib/modules.txt, and lib.name before its include reports the missing include. icon gains fixtures for reading globals while stepping and for begin_function on a non-function, and the suite checks that nothing the compiler reads by default mentions actors. bf.zc, the web sample and std's capture example use qualified runtime names; LEARN.md uses build/bin paths.
* zc: untyped local const, c precedence for && and ||, import fixes for every ↵Gravatar zinc 13 days1-0/+2
| | | | | | | | | | | | | | | | module const name = value; inside a function declares a local constant that takes the initializer's type. the let quick fix now writes a bare const. the self-hosted compiler bound || tighter than &&, unlike zc0 and the readme. no existing source mixed them without parentheses, so only new code was affected. missing-name diagnostics and their quick fixes now search every module: rt, core, run, loaded files, and std, icon and actor scanned from source, including static groups (std.Text.itoa). typos suggest module exports (putc -> rt.put_c) and get a change-to fix.
* lsp: quick fixes for hints and bare library names; comment cleanupGravatar zinc 13 days1-0/+3
| | | | | | | | | | | | | | | | | | | an undefined bare name that a module exports now says which one: "put_c is used but never defined; did you mean to include rt and use rt.put_c?", and the import quick fix is titled the same way and marked preferred when it is the only one, so the editor's auto-fix applies it. hints gain quick fixes that keep the program's meaning: an unused parameter, or a local with no other use, is renamed to _; a constant local with one declarator becomes const; a power-of-two multiply becomes a parenthesized shift (not when a * / or % binds its left operand); and let p = rt.new(n) with a small constant becomes let p[n]. the hints no longer fire for _ discards or for locals already declared const. whole-line /* */ comments in zc sources are // comments now, and //: is gone from the maintained sources: the notes it marked were mostly the documentation of the declaration below, which hovers now show. section headers are separated from the declarations after them.