Skip to content

Cleanup: bench fixtures, FsCache module split, deslop 12.6%, doc refresh (+ main merge)#295

Merged
MelbourneDeveloper merged 13 commits into
mainfrom
cleanup
Jul 7, 2026
Merged

Cleanup: bench fixtures, FsCache module split, deslop 12.6%, doc refresh (+ main merge)#295
MelbourneDeveloper merged 13 commits into
mainfrom
cleanup

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

Consolidation of the cleanup branch — expands the benchmark-fixture suite, splits FsCache into its own module (500-LOC cap), refreshes the READMEs/website, ratchets the deslop duplication gate to 12.6% and simplifies its installer — with current main merged in and every per-crate coverage threshold restored.

What Was Added?

  • 12 benchmark fixtures under benchmarks/fixtures/*.py (~24k lines) expanding the perf suite (aliases, callables, constructors, dataclasses, enums, generics defaults, literals, narrowing, overloads, protocols, returns, tuples).
  • crates/basilisk-checker/src/imports/fs_cache.rsFsCache extracted into its own module so resolve.rs stays under the 500-LOC cap; its tests move with it.
  • Coverage tests restoring three crates that the main merge dropped below threshold:
    • basilisk-parser: unit tests for depth::check_nesting (bracket/indent/operator-chain limits + boundaries, dedent, bracket-resume, chain-breakers).
    • basilisk-resolver: function-body TypedDict tests exercising the recursive check_td_stmts (required/NotRequired key deletes, reads, subscript-assign, disallowed mutator methods).
    • basilisk-cli: stub-subcommand tests (find_package_source, cache_stub, run_stubs*).
  • examples/cpu_demo_loop.py demo.

What Was Changed or Deleted?

  • FsCache split: resolve.rs imports FsCache from fs_cache; apply.rs imports it from super::fs_cache.
  • Checker rule refinements: generics_type_erasure, callables_kwargs, specialtypes_never_2, generics_basic_3/helpers precision changes.
  • Flaky DAP test hardened: debug_spawn.rs a_missing_interpreter_fails_fast_without_port_retries uses 3 candidate ports so the documented free-port TOCTOU can't surface PortTaken before the spawn (assertion unchanged).
  • Deslop gate ratcheted: .deslop.toml max_duplication_percent → 12.6 with non-product excludes; scripts/install-deslop.sh reduced to an unpinned brew install nimblesite/tap/deslop.
  • README refresh: concise vscode-extension/README.md; root README/README.zh; website conformance/benchmark data.
  • Merge of main (PR Six bug fixes: hover inference, glyph tallies, safe-only Fix All, uv import isolation, Modules loading state, deep-expression stack overflow #294: hover inference, glyph tallies, safe-only Fix All, uv import isolation, Modules loading state, deep-expression stack-overflow guard).

How Do The Automated Tests Prove It Works?

  • Conformance (conformance/score.py --gate): 141/141 (100%), 0 false positives, 0 missed required errors against python/typing@main (f4f2952).
  • Per-crate coverage (scripts/test-rust.sh, thresholds in coverage-thresholds.json unchanged): all pass — basilisk-parser 100%, basilisk-resolver 95%, basilisk-cli 91%, basilisk-checker 94%, plus db/lsp/mojo/parser/plugin/stubs/config.
  • Lint: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and the deslop gate (repo-wide duplication under the 12.6% ceiling) all clean.
  • Flaky fix: the debug_spawn suite passes across repeated runs that previously flaked under port contention.
  • Website: gen_conformance_reference.py --check and gen_rules_reference.py --data drift checks clean; 24 Playwright navigation/screenshot e2e tests pass.

Spec / Doc Changes

  • docs/specs/CHECKER-ARCHITECTURE-SPEC.md conformance stamp updated to the graded commit.
  • READMEs (README.md, README.zh.md, vscode-extension/README.md) and website docs refreshed.
  • .deslop.toml duplication budget documented (ratchets down only).

Breaking Changes

  • None

… 100%

Basilisk is now listed in the official python/typing conformance results
(python/typing#2316). Surface that across the site and READMEs, and re-stamp
the graded commit to the current upstream tip.

- Comparison tables (EN + zh homepage) and the /docs/comparison leaderboard now
  show every graded checker's official score, including pycroscope (92.2%), the
  7th tool previously omitted. Basilisk tops the board as the only tool at a
  perfect 100%; each score links to that tool's live results folder.
- READMEs (EN + zh): restore the "only Python type checker with a perfect 100%"
  claim now that it is substantiated by the official results.html and link it
  there (Documentation Honesty: comparative claim carries its source).
- Re-stamp conformance references c94dfce -> f051625 (still 141/141, 0 FP) in
  conformance_report.json, README, and CHECKER-ARCHITECTURE-SPEC to match the
  fixtures the gate now scores against.
- Expand vscode-extension/NOTICES to the full third-party notice set.

pycroscope facts (Python, Apache-2.0, no LSP/debugger/editor extension) verified
against its repository; all conformance figures verified against the live
python/typing results.html at f051625.
# Conflicts:
#	README.md
#	README.zh.md
#	docs/specs/CHECKER-ARCHITECTURE-SPEC.md
#	vscode-extension/README.md
#	website/src/_data/conformance_report.json
The main merge (PR #294) brought code below three crates' coverage
thresholds. Add behavioral tests to restore them; thresholds unchanged:

- basilisk-parser: unit tests for depth::check_nesting (bracket/indent/
  operator-chain limits + boundaries, dedent, bracket-resume,
  chain-breakers) — depth.rs 45% -> 100%.
- basilisk-resolver: function-body TypedDict tests exercising the
  recursive check_td_stmts (del of required/NotRequired keys, reads,
  subscript-assign, disallowed mutator methods) — 94% -> 95%.
- basilisk-cli: stub-subcommand tests (find_package_source success,
  cache_stub, run_stubs* paths) — 87% -> 91%.

Authoritative scripts/test-rust.sh: all coverage thresholds pass,
conformance 141/141 (100%, 0 false positives).
type GoodC1 = Callable[[int], str]
type BadA1 = {"a": "b"}
type BadB1 = var1
type BadC1 = int if 1 < 3 else str
type GoodC5 = Callable[[int], str]
type BadA5 = {"a": "b"}
type BadB5 = var5
type BadC5 = int if 1 < 3 else str
type GoodC9 = Callable[[int], str]
type BadA9 = {"a": "b"}
type BadB9 = var9
type BadC9 = int if 1 < 3 else str
type GoodC13 = Callable[[int], str]
type BadA13 = {"a": "b"}
type BadB13 = var13
type BadC13 = int if 1 < 3 else str
type GoodC17 = Callable[[int], str]
type BadA17 = {"a": "b"}
type BadB17 = var17
type BadC17 = int if 1 < 3 else str
type GoodC21 = Callable[[int], str]
type BadA21 = {"a": "b"}
type BadB21 = var21
type BadC21 = int if 1 < 3 else str
type GoodC25 = Callable[[int], str]
type BadA25 = {"a": "b"}
type BadB25 = var25
type BadC25 = int if 1 < 3 else str
type GoodC29 = Callable[[int], str]
type BadA29 = {"a": "b"}
type BadB29 = var29
type BadC29 = int if 1 < 3 else str
type GoodC33 = Callable[[int], str]
type BadA33 = {"a": "b"}
type BadB33 = var33
type BadC33 = int if 1 < 3 else str
type GoodC37 = Callable[[int], str]
type BadA37 = {"a": "b"}
type BadB37 = var37
type BadC37 = int if 1 < 3 else str
…e shell

GitHub Actions runs steps with `bash --noprofile --norc`, which skips the
profile scripts that add Homebrew to PATH, so `command -v brew` failed on
ubuntu-24.04 (brew is installed at /home/linuxbrew) and the Lint job aborted
before the duplication gate ran. Load brew's shellenv from its known install
locations first. Keeps the unpinned-latest deslop so CI matches local measure.
@MelbourneDeveloper
MelbourneDeveloper merged commit b2d3dcc into main Jul 7, 2026
22 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the cleanup branch July 7, 2026 23:50
MelbourneDeveloper added a commit that referenced this pull request Jul 8, 2026
## What

The `main`→`cleanup` merge in #295 duplicated the `## 致谢`
(Acknowledgments) block verbatim in the Chinese README, so it now
renders **two identical Acknowledgments sections** back-to-back (shipped
in v0.32.0). This removes the duplicate, restoring parity with the
single `## Acknowledgments` in the English `README.md`.

## Why

Surfaced by a post-merge doc-integrity audit of the v0.32.0 release.
Cosmetic, non-blocking — a clean follow-up. No code, no metric, no
sentinel change; the conformance/bench markers are untouched.

## Verification

`grep -c '^## 致谢' README.zh.md` → `1` (was `2`); English README
unchanged at `1`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant