Skip to content

Keep stats rendering with BigInt and circular references - #31

Open
ugin-man wants to merge 1 commit into
tscircuit:mainfrom
ugin-man:codex/fix-nonserializable-stats
Open

ugin-man wants to merge 1 commit into
tscircuit:mainfrom
ugin-man:codex/fix-nonserializable-stats

Conversation

@ugin-man

@ugin-man ugin-man commented Sep 7, 2026

Copy link
Copy Markdown

GenericSolverStatsSummary serializes its tooltip during render. A BigInt statistic or a circular reference throws from JSON.stringify, preventing the component from rendering even when the tooltip is closed.

Serialize BigInt values as decimal strings and circular references as [Circular]. Track the current ancestor chain so shared objects in separate branches retain their contents. Ordinary JSON values and indentation are preserved, and the source stats are not mutated.

Validation: component rendering tests reproduce both exceptions before the fix. All 26 tests (101 assertions) pass after the change, including checks for integer precision, cycles, repeated non-circular references, and ordinary JSON output. tsc --noEmit and bun run build pass.

Prepared with Codex (Astra) assistance and verified locally.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

@ugin-man is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

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