Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b6b312d
bench
MelbourneDeveloper Aug 2, 2026
9839f13
Fixes
MelbourneDeveloper Aug 2, 2026
a054948
Fixes
MelbourneDeveloper Aug 2, 2026
963e04f
fixes
MelbourneDeveloper Aug 2, 2026
88673d2
Fixes
MelbourneDeveloper Aug 2, 2026
62fb812
Merge branch 'main' into bidirectionaltype-inference
MelbourneDeveloper Aug 3, 2026
84a7661
fixes
MelbourneDeveloper Aug 3, 2026
e71384f
Fixes
MelbourneDeveloper Aug 4, 2026
d1764e6
Fixes
MelbourneDeveloper Aug 4, 2026
c009ca5
Merge branch 'main' into bidirectionaltype-inference
MelbourneDeveloper Aug 4, 2026
07e0763
Update issues
MelbourneDeveloper Aug 4, 2026
1658cbc
Integration prerequisite
MelbourneDeveloper Aug 4, 2026
c7d864d
Redirect the integration plan
MelbourneDeveloper Aug 4, 2026
ac25493
doc fixes
MelbourneDeveloper Aug 4, 2026
c796161
fixes
MelbourneDeveloper Aug 4, 2026
aa89199
fixes
MelbourneDeveloper Aug 4, 2026
4ace113
fixes
MelbourneDeveloper Aug 4, 2026
003024a
fixes
MelbourneDeveloper Aug 4, 2026
0350294
Fixes
MelbourneDeveloper Aug 4, 2026
048f86e
fixes
MelbourneDeveloper Aug 4, 2026
8a727b7
fixes
MelbourneDeveloper Aug 4, 2026
c902cc6
ci prep
MelbourneDeveloper Aug 4, 2026
ce4817f
Fixes
MelbourneDeveloper Aug 4, 2026
c2c3e61
bench
MelbourneDeveloper Aug 4, 2026
3295de3
Delete legacy code
MelbourneDeveloper Aug 4, 2026
642ddf9
fixes
MelbourneDeveloper Aug 4, 2026
6b1e513
Fixes
MelbourneDeveloper Aug 4, 2026
41095a9
book
MelbourneDeveloper Aug 4, 2026
b509c30
book etc
MelbourneDeveloper Aug 4, 2026
c633e24
book
MelbourneDeveloper Aug 4, 2026
8fb1e73
fixes
MelbourneDeveloper Aug 4, 2026
ae7ce86
fixes
MelbourneDeveloper Aug 4, 2026
b2de504
fixes
MelbourneDeveloper Aug 4, 2026
a6de567
fixes
MelbourneDeveloper Aug 4, 2026
4a1d2a2
fixes
MelbourneDeveloper Aug 5, 2026
83142b1
fixes
MelbourneDeveloper Aug 5, 2026
e3b31c5
fixes
MelbourneDeveloper Aug 5, 2026
3741268
Fixes
MelbourneDeveloper Aug 5, 2026
a9cb7e5
fixes
MelbourneDeveloper Aug 5, 2026
0a2636c
fixes
MelbourneDeveloper Aug 5, 2026
c041759
fixes
MelbourneDeveloper Aug 5, 2026
5ae7fd7
fixes
MelbourneDeveloper Aug 5, 2026
caacd74
Add benchmark reliability caveat to the benchmarks page
MelbourneDeveloper Aug 5, 2026
231ad97
Remove the benchmark regression gate; fix stale conformance docs and …
MelbourneDeveloper Aug 5, 2026
535ac02
Gate hard on conformance suite freshness; split names_unbound.rs
MelbourneDeveloper Aug 5, 2026
67aef58
fixes
MelbourneDeveloper Aug 5, 2026
831d647
nvim: pin the download version assertion to the release it came from
MelbourneDeveloper Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,6 @@ book/dist/
# without this the residue gets committed and the next run type-checks a file
# the suite believes it created fresh.
vscode-extension/test-fixtures/workspace/ofo_no_scan_target.py


.deslop/
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"basilisk.enabled": true,
"basilisk.uv.enabled": true,
"deslop.topOffenders.splitByLanguage": true,
"deslop.topOffenders.groupBy": "file"
"deslop.topOffenders.groupBy": "type",
"deslop.topOffenders.sortBy": "path"
}
183 changes: 68 additions & 115 deletions CLAUDE.md

Large diffs are not rendered by default.

42 changes: 34 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Exactly 7 standard targets: build, test, lint, fmt, clean, ci, setup
# =============================================================================

.PHONY: build test lint fmt clean ci setup book mutation-test conformance bench bench-basilisk reinstall-vsix reinstall-vsix-macos reinstall-vsix-prerelease
.PHONY: build test lint fmt clean ci setup book mutation-test conformance bench bench-basilisk reinstall-vsix reinstall-vsix-macos reinstall-vsix-prerelease package-zed

# ---------------------------------------------------------------------------
# OS Detection
Expand Down Expand Up @@ -39,6 +39,12 @@ PKG ?= basilisk-checker
# new tests just for mutation. Slow/E2E-ish binaries are deliberately omitted so
# the per-mutant test run stays cheap.
#
# The one class of NEW binary that belongs here is a `#[mutation_safe]` suite
# WIDENING the examined scope ([CHKARCH-TESTING-MUTATION-RATCHET]): those tests
# assert real rule behaviour first and would earn their place with the ratchet
# switched off — they are listed so the functions they newly bring in-scope are
# actually exercised, not scored as missed.
#
# Order matters, but only a little. `cargo test` stops at the first failing
# binary, so a mutant dies as soon as a binary that kills it runs;
# `mutation_kill_tests` exists to kill these mutants, so it runs first. Measured
Expand All @@ -47,6 +53,7 @@ PKG ?= basilisk-checker
# what actually did ([CHKARCH-TESTING-MUTATION-RATCHET]).
_CHECKER_MUTATION_TESTS := \
--test mutation_kill_tests \
--test mutation_kill_constructors_tests \
--test coverage_boost_tests \
--test coverage_boost_32_tests \
--test coverage_boost_33_tests \
Expand Down Expand Up @@ -239,6 +246,9 @@ conformance:
@python3 conformance/run_conformance.py --bin target/debug/basilisk

## bench: Benchmark Basilisk vs pyright/mypy/ty/pyrefly/zuban on the fixture suite.
## INDICATIVE ONLY — this runs on a developer workstation under whatever else it
## is doing, so nothing passes or fails on the result. Compare tools within one
## run; do not compare across machines or across time.
## Requires hyperfine; competitor tools are skipped if not installed.
## run.sh does the CLEAN release rebuild itself (fresh binary under test) before
## timing, so the guarantee holds even when run.sh is invoked directly — this
Expand All @@ -247,14 +257,22 @@ bench:
@bash benchmarks/run.sh

## bench-basilisk: Re-time ONLY basilisk (local iteration on a perf fix).
## Same clean release rebuild, same stability policy, same zero-tolerance gate
## against the committed baseline — it just skips the five competitors, which
## add minutes per iteration and say nothing about a change to this tree. Their
## CSV cells and versions carry forward verbatim and the header records that
## they were not re-timed. Refused in CI, which always runs the full sweep.
## Same clean release rebuild and same stability policy — it just skips the five
## competitors, which add minutes per iteration and say nothing about a change to
## this tree. Their CSV cells and versions carry forward verbatim and the header
## records that they were not re-timed. Refused in CI, which runs the full sweep.
bench-basilisk:
@BENCH_ONLY_BASILISK=1 bash benchmarks/run.sh

## torture: Type-torture scoreboard — hard, spec-grounded typing problems
## scored conformance-style (`# E` lines) against pyright/mypy/ty/pyrefly/zuban,
## every tool in its out-of-the-box defaults, with hang detection as a
## correctness axis. WRITE-ALWAYS to benchmarks/torture/status/torture.csv,
## read-only regression gate against the committed baseline (exit 3).
## Needs target/release/basilisk (or BASILISK_BIN); build it first.
torture:
@python3 benchmarks/torture/run_torture.py

## smoke-micropython: Real-world smoke test for typeshed-path
## [STUBRES-CUSTOM-TYPESHED] — points the checker at a pinned, unmodified
## micropython-stdlib-stubs release and asserts MicroPython stdlib resolves
Expand Down Expand Up @@ -500,8 +518,16 @@ _test_nvim:
_test_zed:
@bash scripts/test-zed.sh

_package_zed:
@echo -e '\033[1m\033[0;36m▶ Building basilisk CLI for Zed\033[0m' && \
## package-zed: Build the local Zed dev loop — compile the extension to WASM,
## install the basilisk CLI, then print the `zed: install dev extension` steps.
## Point the dev extension at the locally built binary with
## `BASILISK_PATH=$$(which basilisk)` or `lsp.basilisk.binary.path`
## ([ZED-DIST]); with neither, it downloads the release binary.
package-zed:
@echo -e '\033[1m\033[0;36m▶ Building Zed extension (wasm32-wasip2)\033[0m' && \
rustup target add wasm32-wasip2 && \
cargo build --release --target wasm32-wasip2 --manifest-path $(_ZED_DIR)/Cargo.toml && \
echo -e '\033[1m\033[0;36m▶ Building basilisk CLI for Zed\033[0m' && \
cargo install --path crates/basilisk-cli --force && \
echo "$$(which basilisk) installed" && \
echo "" && \
Expand Down
14 changes: 7 additions & 7 deletions README-pypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

<p align="center">
<a href="https://www.basilisk-python.dev/docs/conformance/"><strong><!--g:score-->100.0%<!--/g:score--> PEP conformance</strong></a> &mdash; <!--g:pass-->141<!--/g:pass--> of <!--g:total-->141<!--/g:total--> tests in the official
<a href="https://github.com/python/typing/tree/0dc9b5d23b368713af33ac25338eeb08b80f6360/conformance"><code>python/typing</code></a>
conformance suite (commit <code><!--g:short-->0dc9b5d<!--/g:short--></code>), scored on the wheel-installed CLI in its default config by the real upstream harness.
<a href="https://github.com/python/typing/tree/a4906624f170c169cf667f962080c56d5a5ba6ff/conformance"><code>python/typing</code></a>
conformance suite (commit <code><!--g:short-->a490662<!--/g:short--></code>), scored on the wheel-installed CLI in its default config by the real upstream harness.
We target <code>python/typing@main</code> and ratchet the score up only.
</p>

Expand All @@ -49,14 +49,14 @@ And it is the **fastest checker we&rsquo;ve measured** &mdash; median cold full-

| Type checker | Median cold check |
| --- | --- |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->10<!--/g:benchBasilisk--> ms** |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->12<!--/g:benchBasilisk--> ms** |
| zuban | <!--g:benchZuban-->28<!--/g:benchZuban--> ms |
| ty | <!--g:benchTy-->39<!--/g:benchTy--> ms |
| Pyrefly | <!--g:benchPyrefly-->110<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->563<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->583<!--/g:benchMypy--> ms |
| Pyrefly | <!--g:benchPyrefly-->111<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->582<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->605<!--/g:benchMypy--> ms |

Median cold full-file check across <!--g:benchCount-->26<!--/g:benchCount--> single-construct typing-spec stress fixtures on an <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> &mdash; lower is better. Basilisk&rsquo;s warm re-check drops to ~<!--g:benchWarm-->4<!--/g:benchWarm--> ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV &mdash; independent audits are welcome.** [Full benchmarks &amp; methodology &rarr;](https://www.basilisk-python.dev/docs/benchmarks/)
Median cold full-file check across <!--g:benchCount-->26<!--/g:benchCount--> single-construct typing-spec stress fixtures on an <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> &mdash; lower is better. Basilisk&rsquo;s warm re-check drops to ~<!--g:benchWarm-->5<!--/g:benchWarm--> ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV &mdash; independent audits are welcome.** [Full benchmarks &amp; methodology &rarr;](https://www.basilisk-python.dev/docs/benchmarks/)

## Everything in one extension

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

<p align="center">
<a href="https://www.basilisk-python.dev/docs/conformance/"><strong><!--g:score-->100.0%<!--/g:score--> PEP conformance</strong></a> &mdash; <!--g:pass-->141<!--/g:pass--> of <!--g:total-->141<!--/g:total--> tests in the official
<a href="https://github.com/python/typing/tree/0dc9b5d23b368713af33ac25338eeb08b80f6360/conformance"><code>python/typing</code></a>
conformance suite (commit <code><!--g:short-->0dc9b5d<!--/g:short--></code>), scored on the wheel-installed CLI in its default config by the real upstream harness.
<a href="https://github.com/python/typing/tree/a4906624f170c169cf667f962080c56d5a5ba6ff/conformance"><code>python/typing</code></a>
conformance suite (commit <code><!--g:short-->a490662<!--/g:short--></code>), scored on the wheel-installed CLI in its default config by the real upstream harness.
We target <code>python/typing@main</code> and ratchet the score up only.
</p>

Expand All @@ -49,14 +49,14 @@ And it is the **fastest checker we&rsquo;ve measured** &mdash; median cold full-

| Type checker | Median cold check |
| --- | --- |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->10<!--/g:benchBasilisk--> ms** |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->12<!--/g:benchBasilisk--> ms** |
| zuban | <!--g:benchZuban-->28<!--/g:benchZuban--> ms |
| ty | <!--g:benchTy-->39<!--/g:benchTy--> ms |
| Pyrefly | <!--g:benchPyrefly-->110<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->563<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->583<!--/g:benchMypy--> ms |
| Pyrefly | <!--g:benchPyrefly-->111<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->582<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->605<!--/g:benchMypy--> ms |

Median cold full-file check across <!--g:benchCount-->26<!--/g:benchCount--> single-construct typing-spec stress fixtures on an <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> &mdash; lower is better. Basilisk&rsquo;s warm re-check drops to ~<!--g:benchWarm-->4<!--/g:benchWarm--> ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV &mdash; independent audits are welcome.** [Full benchmarks &amp; methodology &rarr;](https://www.basilisk-python.dev/docs/benchmarks/)
Median cold full-file check across <!--g:benchCount-->26<!--/g:benchCount--> single-construct typing-spec stress fixtures on an <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> &mdash; lower is better. Basilisk&rsquo;s warm re-check drops to ~<!--g:benchWarm-->5<!--/g:benchWarm--> ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV &mdash; independent audits are welcome.** [Full benchmarks &amp; methodology &rarr;](https://www.basilisk-python.dev/docs/benchmarks/)

## Everything in one extension

Expand Down
14 changes: 7 additions & 7 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

<p align="center">
<a href="https://www.basilisk-python.dev/zh/docs/conformance/"><strong>PEP 一致性 <!--g:score-->100.0%<!--/g:score--></strong></a> &mdash; 官方
<a href="https://github.com/python/typing/tree/0dc9b5d23b368713af33ac25338eeb08b80f6360/conformance"><code>python/typing</code></a>
一致性套件(提交 <code><!--g:short-->0dc9b5d<!--/g:short--></code>)<!--g:total-->141<!--/g:total--> 项测试中通过 <!--g:pass-->141<!--/g:pass--> 项,
<a href="https://github.com/python/typing/tree/a4906624f170c169cf667f962080c56d5a5ba6ff/conformance"><code>python/typing</code></a>
一致性套件(提交 <code><!--g:short-->a490662<!--/g:short--></code>)<!--g:total-->141<!--/g:total--> 项测试中通过 <!--g:pass-->141<!--/g:pass--> 项,
由真实的上游评分器在默认配置下对 wheel 安装的 CLI 评出。
我们以 <code>python/typing@main</code> 为目标,且分数只升不降。
</p>
Expand All @@ -50,14 +50,14 @@ Basilisk 是**唯一**在官方

| 类型检查器 | 冷检查中位数 |
| --- | --- |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->10<!--/g:benchBasilisk--> ms** |
| ⚡ **Basilisk** | **<!--g:benchBasilisk-->12<!--/g:benchBasilisk--> ms** |
| zuban | <!--g:benchZuban-->28<!--/g:benchZuban--> ms |
| ty | <!--g:benchTy-->39<!--/g:benchTy--> ms |
| Pyrefly | <!--g:benchPyrefly-->110<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->563<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->583<!--/g:benchMypy--> ms |
| Pyrefly | <!--g:benchPyrefly-->111<!--/g:benchPyrefly--> ms |
| Pyright | <!--g:benchPyright-->582<!--/g:benchPyright--> ms |
| mypy | <!--g:benchMypy-->605<!--/g:benchMypy--> ms |

在 <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> 上对 <!--g:benchCount-->26<!--/g:benchCount--> 个单一构造的类型规范压力用例测得的整文件冷检查中位数 &mdash; 越低越好。Basilisk 的热重检查可降至约 <!--g:benchWarm-->4<!--/g:benchWarm--> ms。每个数字都由 [`hyperfine`](https://github.com/sharkdp/hyperfine) 产生并按机器提交,没有一个是手写的。**克隆仓库,在你自己的硬件上运行 `make bench`,并把 CSV 发给我们 &mdash; 欢迎独立复核。** [完整基准与方法论 &rarr;](https://www.basilisk-python.dev/zh/docs/benchmarks/)
在 <!--g:benchMachine-->Apple M4 Max<!--/g:benchMachine--> 上对 <!--g:benchCount-->26<!--/g:benchCount--> 个单一构造的类型规范压力用例测得的整文件冷检查中位数 &mdash; 越低越好。Basilisk 的热重检查可降至约 <!--g:benchWarm-->5<!--/g:benchWarm--> ms。每个数字都由 [`hyperfine`](https://github.com/sharkdp/hyperfine) 产生并按机器提交,没有一个是手写的。**克隆仓库,在你自己的硬件上运行 `make bench`,并把 CSV 发给我们 &mdash; 欢迎独立复核。** [完整基准与方法论 &rarr;](https://www.basilisk-python.dev/zh/docs/benchmarks/)

## 一个扩展,覆盖全部

Expand Down
26 changes: 20 additions & 6 deletions basilisk-zed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,49 @@ Basilisk is the only Python type checker scoring 100% on the [official `python/t
<img src="https://raw.githubusercontent.com/Nimblesite/Basilisk/main/website/src/assets/images/zed-screenshot.png" alt="Basilisk in the Zed editor — Python type checking and diagnostics inline" width="900">
</p>

## Install

Command palette (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **zed: install dev extension** → select this directory (clone [`Nimblesite/basilisk-zed`](https://github.com/Nimblesite/basilisk-zed) first if you do not have the monorepo). Zed compiles the extension to WASM itself — you never pre-build or copy a `.wasm` file.

**You do not install the Basilisk binary separately.** On first activation the extension downloads the matching binary for your platform from the [GitHub release](https://github.com/Nimblesite/Basilisk/releases), caches it inside Zed's extension directory, and reuses it until a newer release appears. Override it only for development or a system install, via `lsp.basilisk.binary.path` in `settings.json` or the `BASILISK_PATH` environment variable.

> The extension is not yet listed in the [Zed extension registry](https://github.com/zed-industries/extensions); until that listing lands, the dev-extension flow above is the install path.

Full instructions, settings, debugging, and the slash-command reference: [basilisk-python.dev/docs/install-zed](https://www.basilisk-python.dev/docs/install-zed/).

## Role in Basilisk

This is the **Zed editor integration**. It is a native Zed extension compiled to WASM that connects the Basilisk language server to Zed, providing real-time diagnostics, hover, go-to-definition, code actions, and debugging via DAP.

## Key concepts

- **WASM extension** — compiled as a `cdylib` crate targeting `wasm32-wasip1`, loaded natively by Zed.
- **WASM extension** — compiled as a `cdylib` crate targeting `wasm32-wasip2`, loaded natively by Zed.
- **`zed_extension_api`** — uses Zed's official extension API for language server lifecycle management.
- **`basilisk-common`** — shares diagnostic codes and constants with the rest of the Basilisk workspace (also WASM-compatible).
- **Tree-sitter grammars** — provides Python syntax highlighting via tree-sitter.
- **Built-in Python, untouched** — binds to Zed's own Python language by name. The extension ships no `languages/` directory and no grammar, so Zed compiles nothing from source and your highlighting, brackets, indent rules, and runnables stay exactly as Zed ships them.
- **DAP debugging** — supports the Debug Adapter Protocol for integrated Python debugging.

## Building

From a monorepo checkout, build the extension and set up the local dev loop:

```sh
make package-zed
```

Standalone (this repository on its own), the build is exactly the one the release pipeline gates the publish on:

```sh
cargo build --release --target wasm32-wasip2
```

## Dependencies

| Crate | Purpose |
|-------|---------|
| `zed_extension_api` | Zed extension API |
| `basilisk-common` | Shared constants and types |

## Status

Phase 2 — extension structure complete, connecting to the Basilisk LSP.

## License

MIT.
Loading
Loading