Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

Brevi v0.28.2

Choose a tag to compare

@github-actions github-actions released this 16 Nov 19:55

Conformance, in full

Native builds of CPython 3.13.13's own tests, measured on Brevi 0.28.2 (2026-11-16). Each test must print exactly what CPython prints.

Core language Standard library
Match CPython 1043 of 1072 (97.3% of the scored suite, with 83 string-as-code tests excluded) 1989 of 2053 (96.9% of the scored suite, with 6 string-as-code tests excluded)
Give a different answer 0 0
Refused by design, left out of the count 83 6
Matches that print something to compare 945 of 1072 (88.2%) 1937 of 2053 (94.3%)
Matches that print nothing (built and exited 0) 98 53
Matches that took the typed build 27 of 1043 (2.6%) 23 of 1989 (1.2%)

Provenance: The reports measured commit e524e954941a; v0.28.2 tags 66d196daaa18, which adds only the conformance reports and floors to it (4 files: git diff --stat e524e95 66d196d), so the numbers describe exactly the released code. All published numbers: docs/NUMBERS.md.

Refused by design means the test runs a string as code (compile, exec or eval), which a sandboxed native binary refuses on purpose. A match that prints nothing only shows the program built and exited 0. The standard library tests cover itertools, collections, re, textwrap, functools, string, graphlib, colorsys, deque, dataclasses and enum. Check your own program the same way with brevi verify.

Paths taken: core 1282 programs: typed 27 (2.1%), pybridge 0 (0.0%), dynamic fallback 1146 (89.4%), refused 109 (8.5%); stdlib 2049 programs: typed 23 (1.1%), pybridge 2 (0.1%), dynamic fallback 1967 (96.0%), refused 57 (2.8%). Only typed and pybridge pass --strict, which fails closed on any fallback; every build reports its path (support matrix).

Changes

  • Security: brevi mcp --http now bounds what a client can make it hold before the token is checked. Chunk sizes that would add up past the 4 MiB body limit are refused (413) instead of wrapping, a body is stored only as its bytes arrive, a connection silent for 30 s or a request not whole within 120 s is closed, and at most 64 connections are served at once (503 past that).
  • Security (Linux and other unix): Brevi's temporary folders (build folders, cargo projects, MCP work folders, the background build slots, and the folder a standalone binary unpacks its CPython into when there is no home folder) now live in a folder private to the user, $TMPDIR/brevi-UID (else ~/.cache/brevi/tmp), used only when it is a real folder owned by the user with no access for anyone else, under folders no one else can change. Before, they were shared names in the temp folder that another local user could make first. With no private folder to use, brevi stops and says why. With no home folder, the cache moves into the private folder too.
  • Security posture stated plainly in SECURITY.md, the README, the docs, both sites, the package READMEs and the skill: no external security audit yet (we are seeking funding for one; until then, do not run hostile code under the sandbox), the sandbox is a policy layer and not an isolation boundary, run untrusted code in a container or VM, and --allow-py / --allow native are full trust. SECURITY.md now says who should use Brevi today (design partners with trusted code in their own container) and what a public beta and a hostile-code claim need first; the audit is on the roadmap. tools/security_claims.py keeps these statements on every page and fails CI on a page that calls the sandbox an isolation boundary.
  • Windows: the 23 stdlib wrong answers found by the first Windows stdlib run are fixed (#587 source paths, #588 CRLF source, #589 cp1252 and re.LOCALE), so the Windows stdlib known-wrong list is empty and this release is the first gated on the Windows stdlib slice. KNOWN_ISSUES.md's Windows section says so.
  • Source files with Windows line ends (CRLF, or a lone CR) now read as CPython reads them: every line end is a newline before lexing, so a triple-quoted string no longer keeps the \r, and a backslash before a CRLF inside a string is a line continuation again. This fixes 13 stdlib conformance tests (textwrap, re error positions) that gave wrong answers on Windows only (#588).
  • Dynamic builds now give CPython's answer for re.LOCALE in Windows' default cp1252 locale (#589). The cp1252 codec (also windows-1252 and 1252) works for bytes.decode, str.encode, bytes(s, "cp1252") and str(b, "cp1252"), with every error handler and CPython's charmap errors. Bytes patterns under re.LOCALE take case and word characters from the C library in the environment's LC_CTYPE locale, as CPython's sre does, on every platform. Under --sandbox, which reads no environment, a re.LOCALE match stops the program instead of guessing the locale.
  • With PYTHONUTF8=1, the CPython that a built program embeds for bridged modules runs in UTF-8 mode, as python3 does. locale.getpreferredencoding() now returns utf-8 there, where before it returned the locale encoding: ASCII under the C locale, and the ANSI code page (cp1252) on Windows.
  • Windows stdlib conformance gates a release. The stdlib CPython conformance slice now has its own Windows floor (compat/conformance_windows_stdlib_floor.json) and known-wrong list (compat/conformance_windows_stdlib_known_wrong/), like the core slice. A release runs tools/conformance.py --slice stdlib --check --release-gate on the brevi.exe it ships, on x86-64 and ARM64, so a Windows stdlib wrong result or a score below the floor or 80% publishes nothing. The weekly Windows job runs both slices and raises both Windows floors on main.
  • Windows: warnings, functools.partial methods, sys.path[0] and os.path.realpath give paths as CPython does (C:\...), never with the \\?\ prefix (#587).
  • One table for every published number. docs/NUMBERS.md is written by tools/published_numbers.py from the release tag's own conformance reports and bench/compare/speed.json: core 1,043 of 1,072 (97.3% of the scored suite, with 83 string-as-code tests excluded), stdlib 1,989 of 2,053 (6 excluded), assertion-bearing 88.2% and 94.3%, typed share 2.6% and 1.2%, and speed as typed median 9.3x against dynamic median 0.85x. CI (--check) refuses a stale table, any page, package README, agent skill, MCP text or release note that quotes the core headline share without that scope, and any that quotes a typed speed median without the dynamic one.
  • The package READMEs (PyPI, npm, crates.io) quoted v0.26's 58% conformance; they now quote v0.28.1's.
  • Release notes say which commit the numbers measured. A release's reports measure the release PR's merge and the tag is the commit that adds them, so the two hashes differ (v0.28.1: measured aa554040, tagged 96a51afc). The notes now name both and check that only reports and floors differ between them.
  • Release notes now open with the conformance numbers in full, for both the core and stdlib slices: matches, wrong answers, tests refused by design (they run a string as code and are left out of the count), the share of matches that print something to compare, the matches that print nothing, and the matches that took the typed build. The notes quote every figure or none: tools/release_notes.py stops if a report lacks one. When the notes of an existing release are rewritten (release-notes.yml), the numbers come from the reports the tag holds, not from main's, and the release's "Tested" line is kept.
  • The conformance reports' percentages are rounded once, from the counts: they rounded the share to four places and then to one decimal, so core assertion-bearing coverage, 945 of 1072 (88.153%), read 88.1% instead of 88.2%. The release gate now compares the counts with the gate too, rather than the four-place rounded share.
  • tools/release_notes.py --check (release preflight) now refuses a report whose printed share is not the counts beside it, rounded once, or whose counts differ from report.json, for coverage, assertion-bearing coverage, typed-path share and the forced dynamic build. report.json now stores the shares unrounded. Every published share, the "Paths taken" line included, is printed by one helper (tools/share.py), which rounds half up: 1 of 16 is 6.3%, where Python's .1f gave 6.2%. The conformance and release-notes unit tests now run in CI.
  • brevi run on a file it hands to CPython now prints its {"path":"cpython",...} note before CPython starts, so the note always comes before the program's output (it was printed after the spawn and could land after lines the program had already written). If CPython then fails to start, a note: not run with CPython line says so.
  • No Rust install needed: with no rustc on the PATH, brevi fetches the Rust release it is tested with on its first build, and zig to link with when the machine has no working C linker, each checked against a SHA-256 compiled into brevi and kept in Brevi's own folder. On by default on Linux x86-64 and macOS (Apple silicon and Intel); Linux ARM64 and Windows (the GNU-ABI Rust with zig, no Visual Studio) are refused with the reason until each passes pinned-toolchain.yml, and BREVI_TOOLCHAIN=pinned tries them. brevi toolchain fetches now and prints what builds use; BREVI_TOOLCHAIN=auto|system|pinned, BREVI_LINKER=cc|zig and BREVI_TOOLCHAIN_DIR choose. uvx --python 3.13 brevi run --verify main.py is a whole install. install.sh no longer installs rustup where the pinned toolchain works.
  • Docs: what a --standalone binary cannot carry.

Prebuilt brevi compiler for Linux, macOS and Windows. On Linux x86-64 and macOS no Rust install is needed: with no rustc on the PATH, brevi fetches the Rust release it is tested with on its first build (and zig to link, if there is no C linker), each checked by SHA-256; uvx --python 3.13 brevi run --verify main.py is a whole install. On Linux ARM64, sh install.sh installs Rust with rustup if it is missing; on Windows, install Rust with rustup and unzip the .zip. Details: https://brevi-lang.org/docs/install

Tested: these binaries were built from 66d196d and passed the full Linux suite, the Windows platform checks, the Windows conformance gates (core and stdlib) and the archive checks in this run.