Skip to content

Benchmarks: compare which mistakes each framework catches, and when #158

Open

Description

@JuroOravec

Problem

The framework benchmarks compare how fast each framework renders the same app. They don't compare how well each framework catches mistakes. That is what decides whether a developer, or an AI coding agent, finds a bug while writing the code or only when a user hits it.

Citry already catches many mistakes before runtime: citry check, the language server and the VS Code extension report typos in component names and event names, wrong types passed to a component's inputs, attribute values that HTML does not allow, Vue bindings that read Python-only variables, and more. We have no measure of how that compares with the other frameworks we benchmark.

Proposal

Add a third kind of benchmark, next to the performance benchmarks and the comparison of how well AI agents work with each framework: we write the same mistakes in every framework and record when each framework reports them.

  1. Collect the mistakes. Gather every typo and error we can think of, every case our tests and lint rules cover, and every bug we've hit in the past. Examples:

    • a misspelled component, prop, event or slot name;
    • a wrong type passed to a component input;
    • an invalid HTML attribute value, such as draggable="treu" or <button type="sumbit">;
    • an emitted event the component does not declare, or a listener for one the child never emits;
    • reading template data or state that doesn't exist;
    • server-side and browser-side mismatches, such as the browser rendering different HTML from what the server sent (a hydration mismatch).

    Sources: the rule ids in packages/py/citry/citry/_diagnostic_catalog.py, the citry_lsp tests, the changelogs, and closed bug issues.

  2. Port each mistake to every framework. Write the smallest app per framework that contains the mistake, adapted to that framework's syntax. Some mistakes can't happen in some frameworks; record those as "not applicable" rather than dropping them.

  3. Score when each framework reports it, using that framework's standard tooling (its type checker, language server or editor extension, linter, build and dev server):

    • in the editor while typing;
    • by a CLI check or build;
    • at runtime, with a clear error;
    • at runtime, silently wrong;
    • never.
  4. Publish the results next to the performance results, and record each framework's tool versions so the run can be repeated.

Scoring questions to settle

  • Decide whether a mistake that a framework's design prevents (for example, a typed API with no string event names) counts as caught or as "not applicable". Step 2 records it as "not applicable" until we decide.
  • Decide how often to update the pinned tool versions, since a tool update can change which mistakes a framework catches.
  • Decide whether a warning counts as caught, or only an error.

Not planned yet

This is tracking only; no work is planned yet.

Related: #92 (AI evaluation suite), #151 (more benchmark frameworks), #149 (citry check reports ~1,600 errors on apps that register citry_ui).

Activity

  1. JuroOravec commented on Oct 20, 2026

    @JuroOravec
    MemberAuthor

    Plan for the next two parts of the error-prevention benchmark, after #205.

    What Citry checks today. Counted from the diagnostic catalog, the
    parser and the runtime: about 118 distinct mistake checks, or 30 if you
    count only diagnostic codes. The gap between the two numbers is mostly
    citry.parse.syntax, which reports 48 different template mistakes. Among
    them are an unknown input, a missing required input, an unknown slot and a
    missing required slot.

    Citry's docs, code and the first run show where it is blind:

    • misspelled CSS variables and class names
    • misspelled HTML attribute and element names
    • payload field names, which are checked only by the 422 at runtime
    • a parent listening for a lowercase event name the child never sends
    • the value a server event returns to the browser

    Part 2: follow the data. Every place where data crosses from one part of
    the app to another gets a row:

    • server to template, browser code and CSS
    • server and browser data into components
    • events, browser to server, and the server's reply
    • slots and the data a slot hands back
    • state, forms, links, translations, file paths, and values shared through
      provide/inject

    At each row we ask four things: are names checked, is a missing required
    value reported, are types checked, are invalid values rejected. The 24
    existing mistakes cover 11 of the 19 rows, and almost none of the "required"
    and "invalid value" checks. 26 new mistakes (m25-m50) fill the gaps; 22 of
    them come from outside Citry's own rule list.

    Part 3: mistakes other frameworks' tools catch. A survey of what each
    framework's own tools check covered:

    • Next.js and React: the TypeScript plugin, eslint-config-next, and runtime
      warnings
    • Nuxt and Vue: the compiler, vue-tsc, and eslint-plugin-vue
    • Django and Jinja
    • the six frameworks not measured yet

    It adds 13 mistakes (m51-m63), all from other frameworks' tools. Citry may
    be blind to these:

    • list keys
    • invalid nesting
    • image alt text, and ARIA names and values
    • duplicate ids
    • disabled="false"
    • handler arguments that do not fit the event

    Citry already catches a few of the 13, such as duplicate attributes and
    two-way binding on an element with no value. After both parts the catalogue
    has 63 mistakes, 51 of them from outside Citry's rule list.

    New frameworks, in this order:

    1. django-components: same typed inputs and slots as Citry, checked only at
      render, so it is the most direct test of Citry's claim.
    2. Reflex: the strongest Python checks before running, but its frontend
      build may make each case slow; measure one case first.
    3. ReactPy and Django Rusty Templates: cheap.
    4. django-unicorn: low to medium cost.
    5. Tetra: the most setup after Reflex.

    PR split. Each PR grows either the mistakes or the frameworks, never
    both:

    1. Let a case describe its mistake as small text edits instead of full
      copies of baseline files. Today 21 FastHTML cases copy all of main.py,
      so any change to the page would mean rewriting them all. Convert the
      existing cases with a script, and prove the conversion by comparing the
      result with the old copies. A second PR lets the browser check type, submit
      and follow links without changing the snapshots that existing cases use.
    2. 13 new mistakes that need no change to the page: 78 cases, about 12 more
      minutes per run.
    3. Browser-side child component and slot data (7 mistakes, 42 cases).
    4. Forms, links, images, CSS variables and translation arguments (5
      mistakes, 30 cases).
    5. The 13 mistakes from other frameworks' tools (78 cases).
    6. Then one new framework per PR, about 62 cases each.

    Each PR commits its new catalogue entries before writing any case, so the
    wording is fixed before a result is seen.

    A full run is about 22 minutes today. With 63 mistakes and 11 frameworks it
    would be about 1.6 hours, and 2 to 3 hours with Reflex. So the plan also
    proposes running two or three frameworks at a time.

    Decisions (2026-10-20):

    • Stricter settings: no separate "strict setup" run. When a framework
      has a setting that turns on a stricter check, and other frameworks here
      have the same kind of check, the benchmark turns it on in that
      framework's normal setup, so the frameworks are compared like for like
      (for example Next.js's typed routes, Nuxt's typed pages, vue-tsc's
      strictTemplates, Jinja's StrictUndefined). The framework notes
      record each setting changed from the default. The published results
      will change in the next run.
    • Conversions: a framework that turns "1" into 1 for you counts
      as "prevented", judged case by case.
    • Reflex: the runtime stage runs only for the cases reflex compile
      did not report.
    • Run cost: a 1.6 to 3 hour full run is acceptable for this round. The
      full matrix does not run at every release.
    • Browser-side components in Django and Jinja: the cases about
      component inputs and slots use Alpine components (x-data with a
      nested component).
    • Lint warnings: Next.js's accessibility lint rules are warnings, so
      those cases score "Static/IDE warning" for Next.js, the same way Citry's
      warnings score.
  2. added
    next-sprint
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions