Design an experiment without promising scheduler internals
Design a falsifiable scheduling experiment
Transitions distinguish non-urgent updates from urgent interactions. React may interrupt and restart transition rendering when a more urgent update arrives; it does not guarantee a precise delay, number of attempts, frame rate or CPU thread. Suspense can display loading boundaries during supported asynchronous rendering; a transition can help retain already revealed UI in appropriate cases. Hydration reuses server-generated HTML and requires consistent initial content. Do not confuse these public behaviors with private lane values or treat an ordinary fetch in an effect as automatically suspending. See Chapters 34, 35 and 39 for dedicated examples.
export const tickets=Array.from({length:600},(_,i)=>({id:i+1,label:`Ticket ${i+1}`}));export function matchTickets(query) { const term=query.trim().toLowerCase(); return tickets.filter(t=>t.label.toLowerCase().includes(term));}import React, {Profiler, useState, useTransition} from 'react';import {matchTickets} from './search.mjs';function Results({query}) { const rows=matchTickets(query); return <><p role="status">{rows.length} results</p><ul>{rows.map(t=><li key={t.id}>{t.label}</li>)}</ul></>;}export default function SearchExperiment({transition=true,onRender}) { const [text,setText]=useState(''); const [query,setQuery]=useState(''); const [pending,startTransition]=useTransition(); function change(e) { const next=e.target.value; setText(next); if(transition) startTransition(()=>setQuery(next)); else setQuery(next); } return <section><label>Find tickets<input value={text} onChange={change}/></label> {pending&&<p>Updating results...</p>} <Profiler id="results" onRender={onRender}><Results query={query}/></Profiler> </section>;}Mount two fresh instances in separate runs, one with transition=false and one with transition=true. Pass a stable onRender callback from the test harness that records the Profiler arguments outside rendering. Type the same sequence of queries and verify that the input and final results agree. Pending UI may be too brief to observe in this small example; absence of a visible pending frame does not establish a scheduler failure. The transition does not move the synchronous filtering function to a worker. For performance experiments record exact React and React DOM patch versions, build mode, browser, CPU throttle, sample size, input sequence and whether StrictMode or Compiler is enabled. Compare equivalent production profiling builds when measuring production behavior; do not compare one development run to another production run.
// Validate final observed UI; no assertion about number of renders or lane IDs.import {matchTickets} from './search.mjs';export function outcomeIssues(observed, expectedQuery) { const issues=[]; if(observed.input!==expectedQuery) issues.push('input'); if(observed.pending!==false) issues.push('pending'); const expected=matchTickets(expectedQuery).map(t=>t.id); if(JSON.stringify(observed.ids)!==JSON.stringify(expected)) issues.push('results'); return issues;}The checker accepts an independently collected input value, pending flag and ordered visible result IDs; it never creates those observations. For query "ticket 600", final IDs should be [600]. With an impossible query, the result should be empty. Capture the DOM after the update has settled with bounded test waiting. The Node tests provide synthetic observations to validate the checker, not React performance. Profiler callback measurements describe committed rendering work, not total browser input latency. Report variation and failures; never turn a single observed order into a lifecycle promise. A separate hydration run should compare deterministic server/client output and capture recoverable errors using the public root API; no actual hydration is implemented here. Practice: write a reproducible trace and distinguish observed outcome, documented contract and source-specific explanation.