Repository navigation
benchmarks(errors): add Django Rusty Templates - #217
Merged
Merged
Conversation
…amed journeys The browser check's clicks become named journeys in each framework's framework.toml, under [runtime.journeys]. The existing clicks are the default journey, recorded at the same three points as before (after the load, after the steps, after a reload). Every other journey starts from a fresh load in a new browser context and records the page once. New `fill` and `press` steps let later PRs drive forms and keyboard flows, and each step accepts only the keys its action uses. The page record also keeps border color, alt, id, aria-* attributes and the disabled state, so a mistake that changes only those reads as "silently wrong" rather than "never" (both still count as missed). Runs of 16 or more hex digits in ids and aria values are blanked before the comparison, because Citry mounts an interactive page into an element with a random id on every render. No existing cell is expected to change: the only "never" cells (m09) edit only the button type text. The published results change only after the next full run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds 13 mistakes to catalogue.toml before any case is written, so the wording is fixed before a result is seen: m29-m35, m38-m42 and m47, the part 2 mistakes that need no change to the reference page. 11 are neutral and 2 (m41, m42) come from Citry's own rule list, which leaves 27 of 37 neutral. The entries are the plan's drafts with two changes: - m32 sends `"1"` instead of `"one"`, and says that a framework that turns the text into a number counts as prevented, following the decision on open question 3. - m30 sends the card's task count instead of its position, because the reference page gives a card no position, and says the mistake does not apply where the event carries no value. The catalogue header and the design doc's fairness rules now name the maintainer's hand-off list (section 2 of the plan) as a neutral source, as the plan requires for these entries to count as neutral. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds a case for each of m29-m35, m38-m42 and m47 in Citry, Django, Jinja, FastHTML, Next.js and Nuxt, as edits to each baseline. Not applicable, with the reason in each port.toml: - m30 everywhere but Citry: the card's hide event carries no value, because the page's listener already knows which card it belongs to. - m34 everywhere but Nuxt: Citry reads $state, the HTMX stacks swap in HTML, and Next's server action returns a bare number. - m40 in FastHTML: the value is written into the script's text, so the browser code reads no name. - m41 in Next.js and Nuxt: the API base is a plain string, and JavaScript has no path type to reach for. - m47 in Citry, FastHTML and Nuxt: the page names no template or component file. Prevented: m32 in Django, Jinja and FastHTML. HTMX sends form fields, which are always text, and the server turns the field into a number, so "1" and 1 send the same request. Fixes made while running the cases, each to make the case express its mistake, not to change its result: the Django and Jinja m42 edits wrote a literal backslash-n into the file (a TOML literal string), which broke Jinja's app.py; the Django m35 edit left extra blank lines that djLint reported (H014), a finding unrelated to the missing fill. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eview An independent review of the new cases found one wrong claim: the m41 not-applicable reasons for Next.js and Nuxt said JavaScript's URL class takes only an absolute address, while it also accepts a relative path with a base address. The reasons now say that a relative setting has no base to resolve against. The other changes are wording only and change no edit: the m32 prevented reasons for Django and Jinja open with why the mistake cannot be written, and several comments say plainly what the case does. The README's reference-page table now lists the new mistakes next to the page part each one uses, and Citry's framework notes point to m29 and m42, which now measure the two related forms the notes describe as unreported. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…istakes A full run of all 37 mistakes in all six frameworks, from commit 1fb5ac267, replaces the 2026-10-20 results (the earlier run of the same day stays in git history). It is also the first published run with the named journeys and wider page comparison from PR 1b; none of the 144 existing cells changed, as the plan expected. Before the app runs (errors plus warnings, of the mistakes that apply): Citry 21 of 35, Next.js 27 of 32, Nuxt 16 of 33, FastHTML 14 of 29, Django 3 of 33, Jinja 2 of 31. Citry misses 10, up from 4: the parent's misspelled listener (m29), an event payload of the wrong type (m30), a misspelled DOM event (m31), a wrong-typed or missing payload field (m32, m33; rejected with a 422 the page never shows), and a secret sent through js_data() (m42), which no framework reports. Also: - the README's notes on single cells explain m30/m34, m32, m35, m38 and m42, and say #207 does not list the new gaps yet; - the docs page's "Catching errors" section and its data file match the run; - the plan marks PR 2 done and records 1b's full run; - wording fixes from an independent prose review in the catalogue header comment (no entry changed), the design doc, the plan and Citry's framework notes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The run used 1fb5ac267; rebasing onto main gave the identical tree the hash 60e9fc2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`citry-errors run --jobs N` (default: half the CPUs, at most 8) runs the cases of every framework side by side. Each clean app still runs alone, before any case, so the comparison point is not measured under load. Records keep the framework and catalogue order whatever order the cases finish in. Dev servers get ports from 20000-31999, below the range the operating system uses for outgoing connections, and a port stays reserved in the process until its server stops, so two workers never share one. A server whose port another program took is started again on a new port. A framework can cap its own cases with `max_jobs` in framework.toml; Nuxt runs one case at a time, because every `nuxt dev` picks its server-side hot reload port from the same 21 ports. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…take as an error The report keeps only where a mistake is first reported, and a static error decides both the errors-only and the errors-and-warnings column, so the browser check cannot change such a cell. Those cases now skip it, and their record names the tool in `runtime_skipped`. A static warning alone still runs the browser check, because the errors-only column can still be decided there. In the 2026-10-20 run this would have skipped 63 of 134 browser checks, about 38% of the run's time. The report and the docs data script already put these cases in the static-error bucket, so no case shows as unscored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t change `citry-errors run` now stores each case's raw output under .benchmarks/errors/results/: what every tool printed, unparsed, and the browser check's record and server log. A later run reuses the stored output when the case's inputs hash the same, and runs only new or changed cases. The hash covers the case's port.toml and copied files, every file of the framework's folder (framework.toml without its notes and max_jobs), the runner code that makes raw output (execute.py, runtime.py, work.py, config.py, cache.py, the runner's lockfile), the Node and Python versions and the working copy's folder. Parsing, comparing and scoring run again on every run from the raw output, so changing them needs no rerun. The page comparison moves from runtime.py to compare.py for this reason. Whether a case skips its browser check is decided again too, so a case whose static catch stops counting gets its browser check on the next run. Output that says more about the machine than about the case is not stored: a stage that timed out or was killed, a server that never answered, a clean app with problems, and anything finished after Ctrl-C. An entry's key file is written last, so an entry a run stopped writing is ignored. run.json lists the clean apps and cases reused whole. `--no-cache` runs everything and stores the fresh output, and a lock keeps two runs off one cache folder. CITRY_ERRORS_CACHE moves the folder. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…red output The README explains --jobs, max_jobs, the stored output and --no-cache, with the Jinja and FastHTML timing. The design doc lists how the runner behaves on a port clash, a worker error, Ctrl-C, a half-written entry, a second run on the same folder and a stale stored output, and its cost section gives the measured times. Section 8 of the plan replaces the one-case-at-a-time estimate with the new one. Progress lines from workers are written one at a time, so lines from cases that finish together no longer run into each other. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…el runs and stored output Stored output: - Nothing of a framework is stored in a run whose clean app had a problem. A broken environment fails every case the same way, and that output would otherwise be reused after the environment is fixed. - A browser check whose journey stopped early is not stored, because a step that ran out of time can come from a busy machine. - The key also covers the installed Playwright, what each framework's environment installed (its venv's pyvenv.cfg, npm's package record), the framework folder's location, and the variables CI, FORCE_COLOR, NO_COLOR, NODE_ENV, NODE_OPTIONS, PYTHONWARNINGS and TERM. - A damaged entry is treated as not stored instead of stopping the run. - `prepare` takes the same lock as `run`, and the lock file keeps the running process's id when a second run is refused. Parallel runs: - After Ctrl-C a running case stops before its next tool or browser check, so the run ends without waiting for builds that have not started. Ctrl-C while the workers start is handled too. - run_all rejects a zero job count or limit, and an error working out a task's framework fails the run instead of ending a worker silently. - Ports come from 20000-24677, below the ports Vite and nuxt dev pick for hot reload. Django's "That port is already in use" also triggers a retry on another port. - The development server starts from a fresh copy of the case, so the browser check sees the same files whether the tools ran in this run or their output was stored by an earlier one. Docs: the README, design doc and plan describe these, correct the retry count, the Nuxt row and the cache-key list, and give the measured rerun time (8 seconds for Jinja and FastHTML, which repeats the 4 browser checks whose journey stops on an error page). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tored output
- The Ctrl-C test waits until both workers are on a case and checks that
both gave up their case before run_all returned; it was racy before.
- A stored entry that cannot be read for any reason, including a
malformed runtime.json, is ignored with a one-line message naming it.
- A framework's location in the checkout is part of its key only when a
command names a file there ({framework} or {repo}), so two checkouts
sharing one cache folder reuse each other's output for the others.
- The toy check stage leaves a file in the working copy, and the toy
browser check fails if it sees it, which proves the server starts from
a fresh copy. New tests cover the stop check before each tool and the
lock file keeping the running process's id.
- Comments and docs: only nuxt dev searches 24678-24698; Ctrl-C waits for
tools and browser checks already started; a missing server log reruns
only the browser check; the rerun time names Jinja and FastHTML.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s apps name The citry and Django framework settings list .python-version among the files that decide when an install is out of date, but the repository's .gitignore ignored it, so a fresh checkout failed in prepare. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the error catalogue
Adds 7 mistakes to catalogue.toml before any case is written, so the
wording is fixed before a result is seen: m25-m28 (inputs of a
browser-side component), m36 and m37 (data a slot hands back to its
fill) and m49 (a component input given a value outside its choices).
All 7 are neutral, which leaves 34 of 44 neutral.
The entries are the plan's drafts with these changes:
- m25 says that where a nested component reads its parent's state
through a shared scope instead of an input, as an Alpine component
nested in another does, the misspelled name is the one it reads. This
follows the decision that Django and Jinja write the status line as a
nested Alpine component.
- m27's example passes the text the status line shows ("open" or
"closed") instead of `String(open)`.
- m28 names the existing Close button instead of "its own button".
- m36's example is `titel` instead of `slot.titel`, since several stacks
read slot data as plain names.
- m37's string-method example spells out `padStart(2, "0")`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hmark's reference apps Adds reference-page parts A and B from the plan to every baseline, each in the framework's usual style: - A: inside Details, a browser-side `Status` component with a required boolean input `open` that shows `Status: open` or `Status: closed`, and a Close button that tells the parent through an event. The Details button reports its state through `aria-expanded`. A new `status` journey clicks Details, Close, then Details again. Citry, Next.js and Nuxt write Status as a component with a declared prop. Django and Jinja write it as an Alpine component nested inside the one that owns `open`, which reads `open` through Alpine's shared scope, as decided for open question 1. FastHTML has no browser-side component model, so it gets only `aria-expanded` and lists no status journey. - B: the card takes a `tone` input with the choices `plain` and `accent` (the featured first card gets a blue border), and hands its title and count back to the footer fill, which now reads `Open Alpha (3)`: Citry slot data, a Vue scoped slot, a React render prop, a Jinja `caller(title, count)`, a FastHTML callback, and in Django the footer block reading the card's own context. Every clean app stays clean: a run of each framework with the new cases reported no baseline finding, no browser error and no journey failure. Existing cases whose `old` text the baselines changed are adjusted to the new text without changing their mistake. A rerun of those 38 cases gave the published cell for every one except Citry m22, whose parser error moved below the window because the card's slot tag now spans five lines. Its new `indirect` note confirms the finding, which restores the cell. The FastHTML m04 and m35 and the Jinja m04 and m35 mistake lines follow the reformatted calls. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…into all six frameworks Adds a case for m25-m28, m36, m37 and m49 in every framework, each run on its own while it was written. Not applicable, with the reason in each port.toml: - m26-m28 in Django and Jinja: the Alpine status component declares no inputs and shares its parent's scope, so there is no input to leave out or give the wrong type, and assigning `open` from the child is an ordinary way to update the parent. - m25-m28 in FastHTML, which has no browser-side component model. m25 in Django and Jinja misspells the name the nested Alpine component reads, as the catalogue entry describes for a shared scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ta cases
An independent review of the baselines and cases found these, now fixed:
- The Django and Jinja status line read the parent's `open` through
`this` inside an Alpine getter, which works only because of how Alpine
merges scopes. It now reads `open` in its markup, as Alpine's docs show
for nested components, and the component keeps a `close()` method that
dispatches the event. m25 there now misspells that markup read.
- Django's `close` listener sat on the status element, so the child set
the parent's value itself. It now sits on the board, as Jinja's sits
on the Details component. m10, m11 and m16 edit that line, so their
`old` text drops the closing `>`.
- Nuxt's `#footer="{ title, count }"` hid the page's own `count` and
drew a `vue/no-template-shadow` warning on the clean app. The fill now
names its slot data `footer`; m05, m35, m36 and m37 follow.
- Django m36 and m37 are not applicable: a Django block takes no
arguments, so the card hands the fill no data of its own. A misspelled
or wrong-typed variable there repeats m07 and m23.
- Django and Jinja m28 are prevented instead of not applicable, like m32:
under Alpine's shared scope the child's assignment works.
- Reasons and notes no longer say Alpine has no inputs (an `Alpine.data`
factory takes arguments and `x-modelable` exists); they say it has no
required or typed inputs. The FastHTML reason says its baseline uses
plain scripts without Alpine. The Citry m36 case notes that the fill
uses the record form, and Citry checks field names only when the fill
unpacks them.
This narrows the plan's decision for open question 1, which ported m25-m28
through Alpine: only m25 has a natural form in an Alpine component that
declares no inputs.
Every clean app stays clean in all stages. Rerunning the affected cases,
and the cases that touch Details, kept every published cell except Citry
m14, which moved from a runtime error to silent: Citry renders an element
that contains a child component in the browser instead of hydrating it,
and Details now contains Status, so the hydration mismatch is no longer
reported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mponent and slot-data mistakes Replaces results/2026-10-20/ with a full run of all 44 mistakes in the six frameworks (264 cases, `--no-cache`, 7.5 minutes), taken at commit 3825b79 after the catalogue entries were fixed in b3b495f. Every clean app was clean in every stage and journey. Compared with the previous run, one existing cell changed: Citry m14 went from a runtime error to missed. Citry 0.6.0 does not hydrate an element that passes values to a child component, and the details panel now passes `open` to `Status`, so the hydration mismatch is no longer reported. Citry m22 keeps its error and is marked as confirmed through its `indirect` note. The new cells: - Citry: m25, m26, m49 in the editor; m36, m37 at runtime; m27, m28 missed. - Next.js and Nuxt: every new mistake in the editor, except m28, which their linters report. - FastHTML: m36, m37, m49 in the editor; m25-m28 n/a. - Django: m25 at runtime; m49 missed; m26, m27, m36, m37 n/a; m28 prevented. - Jinja: m25, m37 at runtime; m36, m49 missed; m26, m27 n/a; m28 prevented. The README gains the new reference-page parts, the status journey and notes on m14, m25-m28, m36 and m37, and the measured full-run time. The docs page's "Catching errors" counts and lists, its data file, and the plan's PR 3 status follow the run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The new `rusty` framework is the Django app with its template backend
switched to Django Rusty Templates, pinned to the git commit the
performance benchmark uses (0725f875). The pinned parser lacks
`{% load %}` of i18n/static, `{% static %}`, `{% translate %}`,
`json_script`, `{% partialdef %}`, `{% extends %}` and `{% block %}`, so
the app builds static URLs from STATIC_URL, translates the heading and
calls json_script in the view, includes the counter from its own
template, and lets the card write its own footer link. The admin app is
left out because its templates need Django's own engine.
All 37 mistakes have a case. Cells match Django's published ones except
m08 (a misspelled attribute raises at render: runtime error) and m05 and
m35 (no footer to fill: not applicable). The report lists the framework
after Django, as the web benchmark does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README explains Rusty's cells that differ from Django's and that it is not in the published run yet, and notes that `prepare` now needs a Rust compiler. The design doc names it among the measured frameworks, and the plan records PR 9 as done ahead of PRs 3 to 5. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eir pins Both apps' pyproject.toml pins djLint to ==1.46.6, while their uv.lock still recorded the earlier >=1.46.6, so `uv lock --check` failed. Only that recorded requirement changes; every locked package version stays the same, so the installed tools are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Rusty app gets the same status line (a nested Alpine component that
reads `open` and dispatches `close`), `status` journey, card `tone` and
footer count as the Django app, and cases for m25-m28, m36, m37 and m49.
m25 to m28 and m49 copy Django's cases unchanged. m36 and m37 do not
apply: with no `{% block %}` the card writes its own footer link, and
even a footer handed over as an included template name would read the
card's own context, so the card hands no slot data to a fill. The m05
and m35 reasons now also say why the app does not use that pattern.
Cases whose edits touch the include, the board wrapper, the card list,
the footer or the Details button follow the new markup.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A run made with CITRY_ERRORS_CACHE pointing into another checkout printed that folder (for example ~/repos/<checkout>/.benchmarks/errors/envs/...) in the published evidence, because only this checkout's folder and the home folder were stripped. Any folder that holds a `.benchmarks/errors` cache, and the configured cache folder itself, now reads as `.benchmarks/errors/`, as the default cache does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…emplates One --no-cache run over all seven frameworks (run 20261020T194609Z, from commit 4253e96 with no uncommitted benchmark changes) replaces the 2026-10-20 results. No cell of the six earlier frameworks changed against PR 3's published run, and neither did their evidence. Rusty matches Django except m08 (runtime error), m05 and m35 (n/a). The docs page's "Catching errors" section, its data file, the README's latest-result notes, the design doc's framework list and cost, and the plan's progress now include the seventh framework. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…doffs # Conflicts: # docs/design/error_prevention_benchmark_plan.md
… benchmarks/errors-faster-runner
… into benchmarks/errors-browser-components
…ents' into benchmarks/errors-fw-rusty
main matches the merged #216, which this branch already contains, so the files are unchanged.
JuroOravec
added a commit
that referenced
this pull request
Oct 20, 2026
main matches the merged #217, which this branch already contains, so the files are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Django Rusty Templates to the error-prevention benchmark (#158, plan PR 9) and publishes a combined run of all seven frameworks. Stacked on #216; merge that first.
The app
extends,block,translate,staticorjson_script. So the view translates the heading and builds the page's JSON itself, static URLs come from{{ STATIC_URL }}, and the admin app is removed (its templates need Django's own engine). Apart from whitespace, the browser gets the same page as the Django app.preparebuilds the Rust extension, so it needs a Rust compiler unless uv's cache already has the build.Results
Rusty differs from Django in three cells:
block, so the card writes its own footer.Rusty could use
{% include footer %}with the page passing a template name. Then a misspelled name raisesTemplateDoesNotExist, and m05 and m35 would be runtime errors. That pattern needs a separate template file for every fill, so these cases treat it as unnatural and count them as not applicable. The case reasons say so.Combined run
run --no-cache, 308 cases, 8 min 40 s. Every clean app passed. Not one cell or evidence line of the other six frameworks changed against #216's published run.Also in this PR
uv.lockrecorded djLint as>=1.46.6whilepyproject.tomlpins==1.46.6, souv lock --checkfailed. Re-locking changed only that recorded requirement; no installed version changed.CITRY_ERRORS_CACHE) printed that checkout's local path in the published evidence. The report now writes any such folder as.benchmarks/errors/, with a test.🤖 Generated with Claude Code