Repository navigation
A field's limit counts letters, performance.now() stops with the machine, file reads leave the JavaScript thread, and a huge display list still draws - #12
Merged
Conversation
… a byte that is not UTF-8 Typed text was cut to a field's maxLength in bytes, so a letter such as é at the limit lost its second byte, and JSON refused the field's value: the interface stopped. The limit now counts UTF-16 units, as the native text input's edits already did, and the view's JSON for JavaScript reads a byte that is not UTF-8 as U+FFFD instead of throwing.
The host's performance.now() was std::chrono::steady_clock, which runs on through sleep on macOS and Windows, so a client could not tell a sleep (the wall clock ran on alone) from a thread that stalled. It now reads the uptime clock on Apple, the unbiased interrupt time on Windows, and CLOCK_MONOTONIC as before on Linux and Android (awake_clock.h).
Hermes has no ECMAScript 2026 Uint8Array.fromBase64, and a loop in its interpreter takes a quarter of a second over a megabyte of base64, all of it in one turn. The host installs a native one when the runtime has none, with the standard's alphabet and lastChunkHandling options and its errors.
…e opens when a character needs it assetText and assetBytes were synchronous calls on the JavaScript thread, which a slow disk held for seconds. They now take a callback: the UI reads on a thread of its own and answers on the interface's, so a host's asset reader must be safe to call from both threads (Ui::Options). The kit's platform wraps the callback in the promise it already returned. The first label laid out opened every face in the fallback chain, the 10 MB CJK faces among them. A fallback face is now opened only when a character the faces before it lack needs it (Typesetter::Chain).
…he GPU for more than it takes A list of tens of thousands of cards made millions of quads, whose vertex buffer the device refused, and the interface was lost. batchesOf now leaves out a quad wholly outside its clip, as the scissor would discard it, and stops at 128 MB of vertices (kMaxVertices): the topmost content goes rather than the frame. Every backend grows its vertex buffer by one shared rule capped there (vertexBufferBytes) and draws nothing for empty batches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five changes made in a game that vendors Bureau, one commit each:
maxLengthcounts UTF-16 units, and the view's JSON survives a byte that is not UTF-8. Typed text was cut to the limit in bytes, so a letter such as é at the limit lost its second byte, JSON refused the field's value and the interface stopped. The limit now counts as the native text input's edits already did, and the view's JSON for JavaScript reads a stray byte as U+FFFD instead of throwing.performance.now()is the time the machine was awake. It wasstd::chrono::steady_clock, which runs on through sleep on macOS and Windows, so a client could not tell a sleep from a stalled thread. It now reads the uptime clock on Apple, the unbiased interrupt time on Windows, andCLOCK_MONOTONICas before on Linux and Android (src/js/awake_clock.h).Uint8Array.fromBase64. Hermes has none, and a loop in its interpreter takes a quarter of a second over a megabyte of base64, all in one turn. The host installs a native one when the runtime has none, with the standard'salphabetandlastChunkHandlingoptions and its errors.assetTextandassetByteswere synchronous calls that a slow disk held for seconds. The UI now reads on a thread of its own and answers on the interface's. The first label laid out also opened every face in the fallback chain, the 10 MB CJK faces among them; a fallback is now opened only when a character the faces before it lack needs it (Typesetter::Chain).batchesOfleaves out a quad wholly outside its clip and stops at 128 MB of vertices (kMaxVertices), and every backend grows its vertex buffer by one shared rule capped there (vertexBufferBytes) and draws nothing for empty batches.What a host must follow
__native.assetText(path, done)andassetBytes(path, done)take a callback instead of returning the file. The kit's platform (kit/native_platform.ts) wraps it in the promise it already returned, so a client that reads through the kit changes nothing; one that called__nativeitself must.Ui::Optionsis now called from two threads (the UI's, for the view's faces and pictures, and the UI's reading thread), so it must be safe to call from both.Checks
eb1b47f, this repository's main. Staged with the game'sbureau:vendor push, which randeno install --frozen,deno fmt --check,deno lint,deno task checkanddeno task testhere before anything was committed; the five commits add up to exactly the tree it staged.src/backends/d3d11.cppandd3d12.cppbuild only on Windows, and neither this repository's workflow nor the game builds them (the game draws through a pass of its own). Each change there is an early return for empty batches and the buffer's size fromvertexBufferBytes.