neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
翻译准备中
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Modern systems programming language and LLVM-based optimizing compiler designed for performance, safety, and ergonomics.
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
A compiled, statically typed language where the compiler decides how memory is managed.
No garbage collector, no free , no lifetime annotations.
[//]: # (No edit are allowed above this line)
Prismio compiles to native code through LLVM. Its compiler is written in Prismio and
builds itself to a byte-identical fixpoint.查看完整 README ↗Prismio compiles to native code through LLVM. Its compiler is written in Prismio and builds itself to a byte-identical fixpoint.
What sets it apart is the memory model. You write ordinary code, and for every allocation site the compiler proves the cheapest management strategy that is safe for it: the stack, a bulk-freed region, a single owner with a deterministic free, or a reference count. It shows you each decision, and it can check them against a real run.
Status: 0.1.0, the first release. Read the release notes. The language and standard library can still change in incompatible ways before 1.0.
macOS and Linux:
curl -fsSL https://prismio.org/install.sh | sh
Windows: download the archive for your machine from the
latest release, unpack it, and
put its bin directory on PATH. Archives are named prismio-<version>-<os>-<arch>
(macos-arm64, linux-x64, linux-arm64, windows-x64, windows-arm64) and come with a .sha256; they are not signed. CI builds and tests macOS arm64, Linux x64 and Windows x64; the two ARM64 archives are built and tested on virtual machines.
The compiler carries its own LLVM, but it links programs with the system's linker, so you
also need the platform's C tools: the Xcode Command Line Tools on macOS
(xcode-select --install), cc and the C library headers on Linux (build-essential on
Debian and Ubuntu), or Visual Studio Build Tools with the Desktop development with
C++ workload on Windows. Then:
$ prismio --version
prismio 0.1.0
llvm 23.1.1
compiler /home/you/.prismio/bin
stdlib /home/you/.prismio/stdlib
import std.display
import std.io
import std.map
import std.string
import std.vec
enum Shape {
Circle(Float)
Rect(Float, Float)
}
fn area(s: Shape) -> Float {
match (s) {
Shape.Circle(r) => { return 3.14159 * r * r }
Shape.Rect(w, h) => { return w * h }
}
}
fn main() -> Int {
let shapes = [Shape.Circle(1.0), Shape.Rect(2.0, 3.0), Shape.Circle(0.5)]
let mut total = 0.0
for s in shapes {
total = total + area(s)
}
println("total area: ${total}")
let mut counts = mapNew<String, Int>()
for word in "a b a c b a".split(' ') {
counts.set(word, counts.getOr(word, 0) + 1)
}
println("a appears ${counts.getOr("a", 0)} times")
return 0
}
$ prismio run shapes.psm
Built shapes
total area: 9.9269875
a appears 3 times
The program allocates and frees memory, but no line of it says so. Ask the compiler what it decided:
$ prismio aif shapes.psm
Storage plan
Stack 9
Arena 2
Scoped heap 0
Unique heap 88
Shared heap 0
Cycle-managed heap 0
...
ID location type storage reason
1 shapes.psm:20:19 [Shape] stack fixed-length array; lives in the frame
2 shapes.psm:20:25 Shape stack small value does not escape
Then run it with the inference checked against every allocation and release:
$ prismio run shapes.psm --verify
...
aif-verify: 13 allocated, 13 released, 0 leaked, 0 violation(s)
Each allocation site is assigned the cheapest tier the compiler can prove safe:
| Tier | Strategy | Runtime cost |
|---|---|---|
| T0 | stack or register (a fixed-length array is T0 too) | none |
| T1 | region: bump-allocated, freed in bulk | a pointer bump |
| T2 | single owner, moved, freed deterministically | one allocation and one free |
| T3 | shared, non-atomic reference count | a count update when sharing survives analysis |
| T4 | atomic reference count, or cycle collection | the only real overhead, and rare |
The rule is that what the analysis cannot prove costs performance, never
correctness; a shape that breaks it is a bug, found by --verify and fixed as one.
prismio aif --why=<ID> explains any decision, --manifest prints a stable form for CI to diff,
and --verify builds a program whose run checks the inference held. The
specification and the design record are in docs/aif/.
The model is still being tightened. Some shapes leak rather than release, and each is listed with a reproducer in KNOWN_ISSUES.md under "Ownership: leaks".
On the maintained suite of 62 workloads, each written the same way in Prismio, C++
and Rust, Prismio's geometric-mean time is 0.85× of C++ (clang++ -O3 -flto) and
0.83× of Rust (-C opt-level=3 -C lto=fat); peak memory is level with C++ and about 5%
below Rust. Measured on 2026-10-06 on an Apple M5 (arm64, macOS), 5 runs each
(report, raw data).
Against C++ it is faster on 24 workloads, level on 33 (inside the suite's noise rule)
and slower on 5: prime_sieve, vector_growth, flat_bitset, large_buffer_copy and
memcpy_mix. Against Rust it is faster on 24, level on 32 and slower on 6:
vector_growth, vector_dot, convolution, channel_pipeline, large_buffer_copy and
indirect_calls. Fifteen more workloads are listed in the suite but
not implemented yet, and are not counted. These are one machine's numbers, not a
promise about yours: docs/PERFORMANCE_PLAN.md lists where
Prismio is slower and why, and the suite, with the rules that keep its three versions
of each workload the same program, is in benchmarks/.
prismio bench re-runs it.
let and let mut; structs, enums with payloads, and match over them.impl blocks, traits with associated types,
borrowed dyn Trait, and closures with Fn(A) -> R bounds.T?, none, ??, unwrapOr, expect) and Result with the usual
combinators; Vec<T>, fixed-length Array<T, N>, Map<K, V>; for ... in over any
type that implements Iterator."${value}"); panic, assert and exit.spawn, join), async fn with lazy Future<T> and await, scope { } and
spawn { } for tasks that cannot outlive the block that started them, and typed channels.extern fn, with ownership stated at the boundary:
produce(free), borrow and alias.build.ums manifest; prismio init, build, run and test.The standard library covers I/O and standard input, files and directories, processes and the environment, time, math, strings, and collections. The runtime surface maps what a program can call. Documentation is the language reference.
To work on the compiler, or to run a platform the release does not ship for, build it
yourself. Requirements: Python 3.9 or later, which is the one thing you install yourself, and a
C toolchain (Xcode Command Line Tools, build-essential, or Visual Studio's C++
tools). tools/setup.py checks the toolchain by compiling and linking a program with
it, says exactly what is missing, and can install it (--install-system-deps, which
asks first). LLVM is pinned and downloaded by the same script; nothing on the system
is used.
git clone https://github.com/prismio-lang/prismio.git
cd prismio
python3 tools/setup.py # check this machine, then LLVM 23.1.1 into third_party/llvm
python3 tools/bootstrap.py --seed --out build/gen0 # first compiler, from the release seed (fetched)
python3 tools/bootstrap.py --compiler build/gen0 --out build/gen1
python3 tools/package.py --compiler build/gen1 --out build/dist
export PATH="$PWD/build/dist/bin:$PATH"
The seed is LLVM IR for an earlier compiler, and it is how a machine with no Prismio
builds its first one. It is bootstrap/seed.ll, committed with the tree, and --seed
reads it. On Windows the script is python3 tools/bootstrap.py -Out build/gen0, then
-Compiler build/gen0 -Out build/gen1.
Once a compiler exists, the checkout is itself a Prismio project: prismio build --release
builds the project's own compiler (run it first, and again after pulling changes to src/), prismio build the one under test, prismio suite and prismio verify test it, and prismio gate is the
check to run before a push (CONTRIBUTING.md).
With the compiler installed or built, start a project:
$ prismio init hello && cd hello
$ prismio run
Built /home/you/hello/.prismio/build/debug/hello
Hello, Prismio!
Or compile a single file with prismio run file.psm or prismio build file.psm.
prismio --help lists every command, including check for editors (JSON
diagnostics, IDE_PROTOCOL.md) and -g for DWARF debug info
(docs/DEBUGGING.md).
Platforms. CI builds and tests Linux (x64), Windows (x64) and macOS (arm64).
Development happens on macOS (arm64) and Linux, so Windows is the least exercised: a compiler
self-hosted there has no export table, and some Windows-only paths are verified by
CI alone. The compiler runs on macOS 14 or later, and the programs it builds on macOS 11
or later. The compiler links three LLVM backends, so --target accepts AArch64, X86 and
WebAssembly triples; WebAssembly IR can be emitted but has no runtime yet. See
Platform and
targets.
| Path | Contents |
|---|---|
src/ | The compiler, in Prismio: lexer, parser, semantic analysis, allocation inference (aif/), IR generation |
std/ | The standard library |
runtime/ | The C runtime, and the LLVM C API backend the compiler calls through src/ir/bridge.psm |
ums/ | UMS, the build manifest and its resolver |
docs/aif/ | The memory model's specification and design record |
tests/ | The compiler suite, tests/test_runner.py |
benchmarks/ | Prismio, C++ and Rust versions of each workload |
bootstrap/ | The seed (seed.ll) a machine with no Prismio builds its first compiler from |
tools/ | Bootstrap, packaging, release gate, lint, LLVM setup, and the AIF oracle (aif_oracle/) |
| Release notes | What changed, release by release |
| KNOWN_ISSUES.md | What is open, with enough of each to act on |
| RELEASE.md | How a release is cut, and what must be green first |
| docs/ | Plans for the standard library, memory, performance, collections and channels |
| Runtime surface, String representation | The runtime surface, and how String is represented |
| CODE_STYLE.md, C_CODE_STYLE.md | How the compiler and runtime are written |
See CONTRIBUTING.md for building, testing, and what a change
needs before review. Most compiler work is Prismio under src/; the runtime and
the LLVM backend are C under runtime/.
Report security issues privately, as SECURITY.md describes.
Apache License 2.0. See LICENSE.
docs/| Plans and design notes for contributors |