Perceus ARC backend (--memory=arc), osprey test line coverage, and standalone-file LSP diagnostics#170
Merged
Conversation
fiber_determinism.osp and fiber_exact_replica.osp carried unresolved conflict markers from an aborted stash merge. Resolve to the top-level handle...in form (matching the tested version on main); drop the stray fn main() wrapper from the stashed side.
# Conflicts: # Cargo.lock # Makefile # compiler/runtime/http_server_request_tests.c # compiler/runtime/http_server_runtime.c # compiler/runtime/http_server_send_tests.c # crates/osprey-cli/Cargo.toml # crates/osprey-cli/src/main.rs # crates/osprey-cli/src/project.rs # crates/osprey-cli/src/test_cmd.rs # crates/osprey-cli/src/wasm.rs # crates/osprey-lsp/src/diagnostics.rs # crates/osprey-project/src/lib.rs # crates/osprey-types/src/builtins.rs # docs/specs/0027-TestingFramework.md # examples/projects/modules/README.md # examples/projects/modules/client/src/data.ospml # examples/projects/modules/e2e/tests/bank.spec.js # examples/projects/modules/src/web/bundle.ospml # examples/projects/modules/web/src/host.js # examples/projects/modules/web/test/host.test.mjs # vscode-extension/client/src/extension.ts # vscode-extension/client/src/test-explorer-parse.ts # vscode-extension/client/src/test-explorer.ts # vscode-extension/package.json # vscode-extension/test/suite/test-explorer-harness.ts # vscode-extension/test/suite/test-explorer-parse.test.ts # vscode-extension/test/suite/test-explorer.test.ts # website/src/spec/0001-introduction.md # website/src/spec/0002-lexicalstructure.md # website/src/spec/0003-syntax.md # website/src/spec/0004-typesystem.md # website/src/spec/0005-functioncalls.md # website/src/spec/0006-stringinterpolation.md # website/src/spec/0007-patternmatching.md # website/src/spec/0008-blockexpressions.md # website/src/spec/0009-booleanoperations.md # website/src/spec/0010-loopconstructsandfunctionaliterators.md # website/src/spec/0011-lightweightfibersandconcurrency.md # website/src/spec/0012-built-infunctions.md # website/src/spec/0013-errorhandling.md # website/src/spec/0014-http.md # website/src/spec/0015-websockets.md # website/src/spec/0016-securityandsandboxing.md # website/src/spec/0017-algebraiceffects.md # website/src/spec/0018-memorymanagement.md # website/src/spec/0019-foreignfunctioninterface.md # website/src/spec/0020-languageserverandeditors.md # website/src/spec/0021-debugger.md # website/src/spec/0022-webassemblytarget.md # website/src/spec/0023-languageflavors.md # website/src/spec/0024-mlflavorsyntax.md # website/src/spec/0025-modulesandnamespaces.md # website/src/spec/0026-documentationcomments.md # website/src/spec/index.md
- osp_release_unique: proved-unique drop with LLVM free-pair attributes so -O2 deletes non-escaping scalar Result alloc+release pairs (restores the dead-allocation elision the ARC ledger's opaque releases had defeated) - benchmarks: osprey-arc, C# (NativeAOT) and Dart (AOT) columns; 22 case ports per language, oracle-verified; refreshed results + baked website tables
MelbourneDeveloper
added a commit
that referenced
this pull request
Jul 22, 2026
Reconcile the parallel Perceus ARC landing (#170) with this branch's superset ARC/GC + benchmark + hardening work. The arc branch already contains a strict superset of #170 (ARC core evolved 29 commits further; test line-coverage explorer, 0027 testing spec, and LSP diagnostics are identical), so every conflict resolved to the arc side and the merged tree is unchanged from arc HEAD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Implements the Perceus ARC reference-counting backend (
--memory=arc, plan 0011 phase 2) end-to-end — counting runtime, full compiler dup/drop insertion, and leak diagnostics — plus native line coverage forosprey test(--coverage/--coverage-json) surfaced in the VS Code Test Explorer, and LSP diagnostics for standalone module-bearing files.Details
ARC memory backend ([GC-ARC-PERCEUS], spec 0018 [MEM-BACKENDS])
compiler/runtime/memory_arc.c: 16-byte header (meta + refcount), probe-first open-addressing registry so foreign/rodata pointers are safe no-ops, kind/mask-driven drop walk (RAW / MASK / list-header variants), immortal values (rc < 0), worklist-based recursive drop, andOSPREY_ARC_DEBUG=1leak statistics.memory_hooks.h+osp_arc_shim.hgive all three backends (default / gc / arc) one IR: default and gc defineosp_retain/osp_release/osp_mem_immortalas no-ops.crates/osprey-codegen: newarc.rsownership ledger inserts Perceus retain/release — producers own +1, dup-on-store, drops at region end and at last use (release_dead_aftercomputes continuation free-idents via the newfreevars::free_idents_of_stmts), returns transfer +1, callees borrow. Owned values spill to null-initialized entry-block slots, so untaken match arms/branches need no dominance analysis. Newmeta.rscomputes the per-allocation kind/mask word for@osp_alloc_tagged(unit-tested against theResult, closure-cell, andHttpResponselayouts).osprey_map_mergereleases unaliased intermediates, fibers release the spawned env cell after the thunk runs, and pointer-erasing boundaries (effect boxing, fiber thunks, fold accumulators) escape-retain before boxing. Container interior nodes stay RAW (leak-safe by construction — never a dangling release); node-level RC is the documented M4b/M5b/M6b remainder in plan 0011.--memory=arcis wired through the CLI/Makefile;make _conformance-arcruns the harness under the counting runtime.Test coverage ([TESTING-COVERAGE-CLI]/[TESTING-COVERAGE-JSON], spec 0027)
osprey test --coverageinstruments each suite with line counters (newcrates/osprey-codegen/src/coverage.rs+compiler/runtime/coverage_runtime.c), prints per-suite and total# coverage:TAP rows, and--coverage-json <path>writes the merged machine-readable report. Coverage never changes suite outcomes or exit codes.--coverage-jsonand feeds line hits into the native VS Code coverage API (test-explorer.ts,test-explorer-parse.ts).LSP
diagnostics.rsgainsstandalone_diagnostics: module-bearing files no project claims (test suites, standalone scripts) are assembled the same way--check/osprey testdoes, so the editor stops reportingunknown identifierfor a file's own modules (backed by the newosprey_project::needs_assembly).Docs/examples: plan 0011 checklist updated to the landed state; spec 0018 status rewritten; Talon Bank gains
accounts.test.ospml; committed wasm bundles regenerated for the new codegen.How Do The Automated Tests Prove It Works?
crates/diff_examples.sh) passesPASS=148 FAIL=0 NOEXP=0+FC_OKwith byte-identical output under all three backends (default,--memory=gc,--memory=arc) — the [MEM-BACKENDS] conformance bar. WithOSPREY_ARC_DEBUG=1, container-free examples (comprehensive_math,record_update_basic,algebraic_effects_comprehensive,fiber_determinism) report zero live language values at exit.meta.rsunit tests (result_block_masks_depend_on_payload,http_response_marks_words_1_2_5,oversized_structs_fall_back_to_raw) pin the mask encoding to the real C ABIs, including the sign-bit word-55 edge.coverage_runtime_tests.ccovers the C coverage collector; the string/profiler C suites andcargo test --workspace(all crates, ~1100 tests) are green; per-crate coverage thresholds incoverage-thresholds.jsonall met ([rust] OK: all crates meet their thresholds, extension 97.7% ≥ 95%).test_cmd.rstests (only_test_suffixed_files_are_recognized,coverage_dump_path_is_stable_and_scratch_scoped, arg-parse tests for--coverage-json) plus extension suitestest-explorer-parse.test.ts/test-explorer.test.ts(coverage args, JSON parsing, line-hit reporting) — extension suites 3/3 green under the real VS Code host.cross_flavor_ir_equivproves.osp/.ospmltwins still lower to byte-identical IR with ARC insertion enabled.osprey test, 13 TAP tests) and bank Playwright e2e (17 passed) run the compiled ARC-era binary serving real HTTP; wasm golden suitePASS=49 FAIL=0proves the retagged allocator links and runs on wasm32-wasip1; website Playwright 76 passed; Docker web-compiler test passed.