npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@atropyle/circuits

v0.2.0

Published

Atropyle policy circuit: NetlistVM builder, bitsliced simulator, reference model and exhaustive proof.

Readme

@atropyle/circuits

The Atropyle policy circuit for TapeOut on X Layer, plus the tools that prove it:

  • a NetlistVM byte-stream builder (Netlist), and the reusable sub-circuits KofN5 and Ge4;
  • a 32-lane bitsliced simulator (compile, stepBytes) with the same semantics as the on-chain NetlistVM;
  • the reference model (refStep) and an exhaustive check of properties P1–P8 over all 2^26 inputs (verifyPolicy).
import { buildAll, verifyPolicy } from '@atropyle/circuits';

const { program } = buildAll();
const report = verifyPolicy(program);
console.log(report.mismatches === 0 && report.violations.every((v) => v === 0));

To check the circuit that is live on chain, use npx -y [email protected] verify or verifyPolicy() from @atropyle/sdk.

Try to break it

Break one gate of a copy of the policy and see the proof catch it. Everything runs on a program in memory: the deployed circuit cannot change.

import { buildAll, faultPath, firstViolation, mutate } from '@atropyle/circuits';

const { program } = buildAll();
const broken = mutate(program, { gate: 120, kind: 'stuck1' }); // or 'stuck0', 'rewire', 'and'
const r = firstViolation(broken.program, { reference: program });
if (r.counterexample) {
  const cx = r.counterexample; // state, inputs, next, out, the model's answer, the properties it breaks
  console.log(cx.property, cx.story); // P3 inherit-without-votes
  console.log(faultPath(program, broken, cx.state, cx.inputs).gates); // the gates the fault runs through
} else {
  console.log(r.complete); // true: the copy equals the policy on all 2^26 combinations, so this break changes nothing
}
  • mutate(program, mutation): one gate (0 … 195, NAND gates in run order) stuck at 0, stuck at 1, with input a wired to another signal, or computing AND. The original is not changed.
  • firstViolation(program, options): visits the seed blocks first (POLICY_SEED_BLOCKS, regenerated by npm run seeds), then every block, and stops at the first counterexample. With no counterexample it has checked all 67,108,864 combinations. verifyPolicy is unchanged.
  • storyOf(counterexample): one plain sentence, true of that counterexample, and the property it is about.
  • isLifelike(case): true when a deployed vault can ask the circuit that case, by the rules of the vault contract (counterexample.lifelike). firstViolation shows such a case first.

test/mutation-score.md classifies all 784 single-gate mutations (196 gates, four kinds) as caught or redundant: 743 caught with a counterexample checked against the reference model, 41 redundant (3 stuck at 1, 38 rewires), where the copy answers like the policy on all 67,108,864 combinations. 730 of the 743 are shown with a case a deployed vault can ask the circuit; the other 13 have no such failing case anywhere. test/mutation-score.test.ts rebuilds it; run npx vitest run -u test/mutation-score.test.ts after a change to the policy, and npm run seeds if it reports a mutation that only the full scan catches.

The web app runs the same code in a worker on its proof page: /proof/#sabotage=122,stuck1 breaks gate 122 and shows the case that breaks P3, "With this gate broken, your heir could claim while you are still checking in."