Skip to content

The parse cache keeps a parse for each value of the downcasting setting - #1517

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
parse-cache-by-downcasting
Sep 27, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
parse-cache-by-downcasting

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Closes #1513.

MathS.FromString kept one parse cache for each value of ExplicitParsingOnly, but not of DowncastingEnabled. That setting changes the parse too: with it off, the 2 in x^2 is a decimal Real. A string parsed once under one setting therefore came back under the other with the first parse's numbers. There is now one cache for each pair of the two settings.

The 0, 1 and -1 shortcuts before the cache are unchanged. They return integers whatever the setting, as they did.

Measured

  • The unit suite passes on net10.0: 12875 passed, 14 skipped, none failed, of 12889.
  • The new test binds: TheCacheKeepsAParseForEachDowncastingSetting fails with the library change reverted.
  • The allocation gate passes on all 19 gated benchmarks, with no allocation moved. The one added read of a setting on a cached parse doesn't show beyond the noise: ParseEasy took 1.03x.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

FromString kept one cache for each value of ExplicitParsingOnly, but not of
DowncastingEnabled, and that setting changes the parse: with it off, the 2
in x^2 is a decimal. A string parsed once under one setting came back under
the other with the first parse's numbers. There is one cache for each pair
of the two settings now.

Closes #1513.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 2880133 into master Sep 27, 2026
31 checks passed
Rafael-SOWNet added a commit that referenced this pull request Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet added a commit that referenced this pull request Oct 9, 2026
* Breaking-changes entries for #1828 to #1832 and #1374

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

* And for #1368, #1611 and #1517, each measured on 2.5.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

* And for #1289, #1312, #1315, #1377, #1380 and #1371, each measured on 2.5.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

The parse cache ignores DowncastingEnabled: a string parsed under one setting comes back under the other

1 participant