Skip to content

docs(research): rescore critical review against past 3 days - #55

Merged
Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
docs/critical-review-april-2026-rescore
Apr 21, 2026
Merged

Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
docs/critical-review-april-2026-rescore

Conversation

@codemonkeychris

Copy link
Copy Markdown
Collaborator

Summary

  • Rescore Reactor as a skeptic against the ~175 commits that landed since the last review update
  • Add three new sections (Async Resources, Charting + Chart A11y, Devtools MCP + ETW), update executive summary, scorecard, and conclusion
  • Candid/direct per the goal: features are impressive but integration debt is widening — showcase apps still don't use the framework's own features, async resources is shipped without field evidence, velocity is outpacing integration

What changed

New sections (~1,100 lines added):

  • §3a Async Resources (B+) — UseResource / UseInfiniteResource / UseMutation / Pending, AsyncValue ADT, QueryCache. Honest tradeoffs vs. TanStack Query.
  • §11a Charting + Chart A11y (B+) — 8-layer a11y, LCH palette hardening, 12 scanner rules, 43 samples retrofitted. No sonification, ForceGraph a11y decorative-only.
  • §13a Devtools MCP + ETW (B) — MCP server (HTTP+stdio), 12+ tools, stable node ids, ETW provider. State is read-only, no source mapping, premise is an AI-agent bet.

Updated:

  • Executive Summary (added bullets 10-13, revised verdict)
  • §3 State Management (async hooks added; "no Suspense" narrowed to "no code-splitting")
  • §5 Layout (FlexPanel CSS-semantics fix note)
  • §6 Styling (DUCT_/REACTOR_ ID naming inconsistency)
  • §13 DX raised C+ → B
  • §15 Scorecard (added Async Data, Charting, Devtools rows; DX C+→B; A11y B-→B)
  • §16 Conclusion (+5 strengths, +3 weaknesses, expanded todo list 9→14, new recurring theme)

Test plan

  • Review reads as candid and direct, not hyperbolic
  • Grade changes are justified by cited commits
  • New sections (3a, 11a, 13a) stand on their own and cross-reference appropriately
  • Scorecard matches the narrative grades in each section
  • No broken internal links in table of contents

…d work

Rescore Reactor as a skeptic against the ~175 commits that landed since the
last review update. Add three new sections and update existing grades.

New sections:
- 3a. Async Resources (B+) — UseResource/UseInfiniteResource/UseMutation/
  Pending, AsyncValue ADT, QueryCache. Skeptic notes: in-process-only,
  no retry default, no devtools surface, PendingScope boxes context, no
  field evidence at scale.
- 11a. Charting and Chart Accessibility (B+) — 8-layer a11y infrastructure,
  LCH palette hardening, 12 scanner rules, 43 samples retrofitted.
  Skeptic notes: no sonification, ForceGraph a11y decorative-only,
  hit-target expansion opt-in, per-point peer allocation unbounded.
- 13a. Devtools MCP and ETW Tracing (B) — HTTP+stdio MCP server, 12+
  tools, stable node ids, ETW provider. Skeptic notes: state is
  read-only, no source mapping in v1, no cache inspection, premise
  is a bet on AI-agent audience.

Updated:
- Executive Summary + verdict paragraph
- §3 State Management (async hooks added; "no Suspense" bullet narrowed
  to "no code-splitting")
- §5 Layout (FlexPanel CSS-semantics fix note)
- §6 Styling (DUCT_/REACTOR_ ID naming inconsistency)
- §13 DX raised C+ → B (ETW, 4 hook analyzers, MCP devtools,
  4,222 lines of coverage tests)
- §15 Scorecard: added Async Data + Charting + Devtools rows; DX C+→B;
  Accessibility B-→B
- §16 Conclusion: added 5 "gets right" points, 3 new "prevents production-
  ready" points (no field evidence on async, velocity outpacing
  integration, naming churn), expanded to-do list from 9 to 14 items,
  new recurring theme (velocity outpacing integration), candid final
  paragraph.
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit 2a5aac4 into main Apr 21, 2026
3 checks passed
@codemonkeychris
Chris Anderson (codemonkeychris) deleted the docs/critical-review-april-2026-rescore branch May 28, 2026 19:11
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Fix A (#55) replaced UseElementFocus's per-render closure — which captured
immutable locals — with a single shared FocusHookCache whose UiQueue (write-once)
and State (refreshed each render) fields are written on the UI render thread and
read inside the cached RequestFocus closure. RequestFocus is documented as callable
from a background thread (task continuations), so those fields were read
cross-thread without synchronization. On a weak memory model (ARM64) a background
invoke could observe a stale UiQueue (spurious null -> wrong synchronous off-thread
focus) or an outdated FocusState.

Fix: mark UiQueue and State `volatile` so the cross-thread reads/writes get
release/acquire semantics (FocusState's int underlying type makes the enum field
legal to mark volatile). RequestFocus stays plain — it is write-once and only read
on the render thread. No allocation or semantic change; same low-cost field store
per render. Mirrors the UseReducer threadSafe Volatile fix in the prior commit.

Validated: core lib `-c Release` 0W/0E; tests/Reactor.Tests 9719 passed / 0 failed
/ 64 skipped.

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Every component re-render re-runs every hook, so per-render hook
allocations multiply by cells x hooks on data-grid workloads
(StocksGrid). This eliminates the hot-path allocations in the hooks
bookkeeping layer while preserving the rules of hooks (same call
order/count/types every render) and observable semantics.

RenderContext.cs:
- #42 ValueHookState Lock is now lazy/nullable (allocated only when
  threadSafe:true); saves N rows x M hooks of unused Lock objects.
- #43 UseState setter cached on the hook slot (built once, not a new
  display-class + Action<T> every render).
- #44 UseReducer<T> updater and UseReducer<TState,TAction> dispatch
  delegates cached on the hook; dispatch reads the latest reducer from
  state (matches React semantics).
- #45/#46/#48 UseEffect/UseMemo/UseCallback gain arity 1-3 deps
  overloads that compare deps without boxing and allocate the deps
  array only when deps actually change; params overloads kept as
  fallback and now assign Dependencies directly (no extra ToArray).
  UseCallback no longer allocates a ()=>callback wrapper.
- #50 _hooks list pre-sized to new(8) to avoid mount realloc churn.
- #51 ContextHooks uses a struct enumerator (no heap enumerator per
  render); still implements IEnumerable for existing .ToList() callers.
- #52 UseCommand/UseCommand<T> use an inline memo slot instead of a
  per-render factory closure capturing 7 vars.
- #53 UsePersisted setter cached on the hook slot.
- #56 new internal UseDisposableEffect(IDisposable) mount-once helper
  with a stable teardown (no 2 lambdas per render).

Hooks/:
- #47 UseMemoCells/ByKey/ByIndex early full-reuse: return the prior
  children array and skip snapshot/dict allocation on a full cache hit.
- #59 UseMemoCellsByKey computes each key once per item into a buffer
  instead of invoking the key selector twice.
- #55 UseElementFocus caches the requestFocus closure and DispatcherQueue
  in refs instead of allocating + a COM call every render.
- #57 UseResource uses an Interlocked counter id (not Guid.NewGuid) and
  skips the deps-hash rebuild when deps are unchanged; #56 disposes via
  UseDisposableEffect.
- #56 UseMutation/UseInfiniteResource dispose via UseDisposableEffect.

PanelAttachedHooks.cs:
- #60 ApplyRelativePanelAttachedProps reuses a thread-static name-map
  dictionary (with a reentrancy guard for nested RelativePanels) instead
  of allocating one per reconcile.

Tests: tests/Reactor.Tests/HookAllocationPerfTests.cs (25 tests) cover
cached-delegate identity across renders, deps short-circuit (params +
arity), threadSafe Lock still allocated + correct under concurrent
writes (null when not requested), and UseMemoCells/ByKey/ByIndex
cache-hit returning the same prior children array.

The two committed skills/reactor.api.txt copies are regenerated to add
the new public arity overloads (UseDisposableEffect stays internal).

Closes #659

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Fix A (#55) replaced UseElementFocus's per-render closure — which captured
immutable locals — with a single shared FocusHookCache whose UiQueue (write-once)
and State (refreshed each render) fields are written on the UI render thread and
read inside the cached RequestFocus closure. RequestFocus is documented as callable
from a background thread (task continuations), so those fields were read
cross-thread without synchronization. On a weak memory model (ARM64) a background
invoke could observe a stale UiQueue (spurious null -> wrong synchronous off-thread
focus) or an outdated FocusState.

Fix: mark UiQueue and State `volatile` so the cross-thread reads/writes get
release/acquire semantics (FocusState's int underlying type makes the enum field
legal to mark volatile). RequestFocus stays plain — it is write-once and only read
on the render thread. No allocation or semantic change; same low-cost field store
per render. Mirrors the UseReducer threadSafe Volatile fix in the prior commit.

Validated: core lib `-c Release` 0W/0E; tests/Reactor.Tests 9719 passed / 0 failed
/ 64 skipped.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant