Skip to content

0.147.0: name_finder reads a text once whatever the names, and lists the names elements share - #46

Merged
tmoosting merged 1 commit into
mainfrom
name-finder-linear
Nov 24, 2026
Merged

tmoosting merged 1 commit into
mainfrom
name-finder-linear

Conversation

@tmoosting

Copy link
Copy Markdown
Member

The twin of the TypeScript SDK's change (OnlyWorlds/sdk pull request 61), from the same cases file.

name_finder walked its trie again from every place a name could start, so the work for a text was its length times the longest name's length. It now holds the names backwards in one matcher with failure links and reads each text once, from its end to its start: the work grows with the text's length alone.

It also adds find.shared: every name two or more elements hold, each a NameShared (name, elements). The finder never answers such a name, and until now nothing said it was there. name_finder now answers a NameFinder, called on a text as before.

No answer moves.

  • The cases file is the SDK's, byte for byte (version 2: the 47 earlier cases unchanged, 15 more, a shared list on every case, three timed recipes with a name of thousands of characters).
  • The released 0.146.0 gives the hand-written answer on all 62 cases and runs past a 60 second limit on two of the new timed recipes; this build answers them in 53 ms and 82 ms.
  • Four builds answer the same on 4,506 made texts in 1,400 made worlds: the released SDK and Python packages and the two new builds. The two builds list the same shared names in every one of those worlds. A planted difference is caught in each compare.
  • Seven faults planted one at a time each turn the tests red.

🤖 Generated with Claude Code

…the names elements share

The matcher holds the names backwards with failure links and reads the text once from its end, so the work
for a text grows with its length alone. find.shared lists every name two or more elements hold. The cases
file moves to version 2, the same bytes as the TypeScript SDK's: 15 more cases, a shared list on every case,
three timed recipes with a name of thousands of characters.
@tmoosting
tmoosting merged commit dd867ec into main Nov 24, 2026
11 checks passed
@tmoosting
tmoosting deleted the name-finder-linear branch November 24, 2026 01:23

This branch was previously deployed

1 inactive deployment
pypi — dd867ec4 Deployed Nov 24, 2026 by tmoosting via publish #234
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