Repository navigation
fix(web): template-elide probe must mirror the walk's tag-name derivation - #911
Merged
Merged
Conversation
…tion PR #910's fast path probed for the contiguous substring `<template`. That is NOT equivalent to the walk it replaces: the walk derives its tag name from `lower.substring(lt + 1, gt).trim()`, so `< template>` and `</ template>` reach `name == "template"` while containing no contiguous `<template`, and the fast path returned a document whose template body the walk elides. #910's fixture set had no whitespace-after-`<` shape, which is why its spec passed. Round-9 order: the shapes were added to the adversarial fixture FIRST and the spec confirmed failing on them (`[12] MISMATCH fast_len=68 slow_len=34`, `[13] MISMATCH fast_len=70 slow_len=34`), then the probe was replaced. `_html_template_tag_present` mirrors the walk's own derivation: for each literal `template` occurrence, walk back over whitespace, optionally one `/` and more whitespace, and test for `<`. Bounded by the occurrence count (2-3 per catalog page), not by document length. A bare-word probe would have been trivially correct and is NOT usable: all eight catalog pages contain the word `template` (prose and `grid-template-*`), so it would have deleted the entire win. That fixture row is now in the spec so the shortcut cannot be taken later. Re-measured on the corrected probe, 2 alternating A/B pairs on a busier host (sel_match 911-947 vs 608-681 in #910's sweep): pp_css 1223 -> 554 and 1165 -> 551 ms across the eight pages, same -55%, controls flat within each pair, 8/8 Draw IR digests identical on all four runs. Gates: equivalence spec 2/2 (16 adversarial documents, up from 12); GPU boundary audit PASS. Doc: doc/10_metrics/ui/web_perf_round10_2026-09-13.md gains a Correction section at the top, and the `tail_inline` follow-up note is fixed (one unmemoized apply, not three -- the other two sit at the timer floor). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi
ormastes
had a problem deploying
to
self-review-admission
September 13, 2026 13:11 — with
GitHub Actions
Error
This branch was successfully deployed
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.
Correction to #910, found by review the same day.
The defect
#910's fast path probed for the contiguous substring
<template. That is not equivalent to the walk it replaces. The walk derives its tag name fromso
< template>and</ template>reachname == "template"while containing no contiguous<template— and the fast path returned the document unchanged where the walk elides a template body. #910's twelve adversarial fixtures had no whitespace-after-<shape, which is exactly why its spec passed.The fix, in round-9 order
[12] MISMATCH fast_len=68 slow_len=34 [13] MISMATCH fast_len=70 slow_len=34_html_template_tag_present, which mirrors the walk's own derivation: for each literaltemplateoccurrence, walk back over whitespace, optionally one/and more whitespace, and test for<. Bounded by the occurrence count (2-3 per catalog page), not by document length.A bare-word probe (
find_from(lower, "template", 0)) would have been trivially correct and is not usable:grep -ic templatefinds the word on all eight catalog pages (prose andgrid-template-*), so it would have deleted the entire win. That fixture row is now in the spec so the shortcut cannot be taken later.The win survives
2 alternating A/B pairs on the corrected probe, on a much busier host than #910's sweep (
sel_match911-947 vs 608-681):Same -55%, controls flat within each pair, 8/8 Draw IR digests identical on all four runs.
Gates
web_template_elide_fastpath_equivalence_specPASS — 2 frame(s) audited, host_pixel_iterations=0, readbacks_per_frame<=1, submits_per_frame<=1PASSAlso fixes a wrong claim in the round-10 doc:
tail_inlineis ONE unmemoizedapply_decls_without_display_on_writing_modecall (oninline_normal), not three — thecombined_important_declsandinline_importantsiblings both sit at the ~44 ms timer floor. The doc gains a Correction section recording this whole episode.🤖 Generated with Claude Code
https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi