test: cover file task delivery, replacement, cancellation and provider failures
Verify Tessera GUI / verify (push) Failing after 9m15s

This commit is contained in:
2026-10-23 12:06:44 +08:00
parent 047e008729
commit 05b727a4a5
6 changed files with 225 additions and 31 deletions
+7 -3
View File
@@ -471,9 +471,8 @@ Scheduling/cancelling in read-only render/binding calls is rejected.
Limits are 64 pending tasks per owner, 1024 per runtime, and 64 ready callbacks per
worker poll, each with 128 frames/100,000 instructions. Remaining ready work stays
pending for later polls. This is currently a timer provider and task-lifecycle
foundation; network/file providers, await/coroutines and interrupting a blocked
native callback are not implemented. See [owned-tasks.endor](examples/owned-tasks.endor)
pending for later polls. Timers and asynchronous UTF-8 file reads use the same task lifecycle.
Network providers, await/coroutines and interrupting a blocked native callback remain unimplemented. See [owned-tasks.endor](examples/owned-tasks.endor)
for real Endor code and native buttons.
Typed capability methods cannot be shadowed by instance attributes. Aster checks ordinary writes, type attachment and capability declaration before changing state; queries and method invocation reject backing-store conflicts introduced through trusted host access. The render cache subscribes to these method attribute keys and validates dirty Blocks before native dispatch, so direct storage changes cannot silently leave source calls and rendering on different methods. Removing the conflicting attribute restores the instance. Class method overrides and event subscriptions keep their existing APIs.
@@ -551,3 +550,8 @@ Layout and paint drivers now prepare one occurrence at a time. Their fixed-size
ui.stats().dependencyInvalidations counts observed layout/paint dependency version mismatches. lastInvalidDependency records the phase, object kind/identity and old/current versions without rendering its fields or retaining it. An input changing its globals is an expected invalidation; compare idle document versions before diagnosing a refresh loop.
ui.readText(owner,key,path[,callback]) returns an owner-scoped Task and reads a regular UTF-8 file off the VM thread. Paths use native filesystem syntax; absolute paths are recommended. The optional callback takes zero arguments and must return Unit; it runs only on successful read and can use task.result(). Without a callback, poll status then read result from code. result() is available while a success callback is running or after completion (timers return Unit); error() returns an empty String or the provider/callback error. A provider failure marks the task failed and skips its callback without stopping the VM; a source callback failure still stops the shared domain. Owner/key replacement, explicit cancellation, close/reset/VM discard and GC drop the provider lease, remove queued completion and reject late delivery. In-progress OS reads may finish, but cannot deliver after cancellation. Only the owning VM worker updates managed results and rechecks owner/key identity. No VM handles enter provider threads beyond opaque weak identities.
The lazy shared pool has four threads and a 64-job queue. Each runtime permits 16 outstanding file requests (one temporary replacement reservation), and each read is capped at 1 MiB by metadata plus actual streaming length; non-regular files, non-UTF-8 data and over-limit content fail rather than truncate. These limits do not constitute a full filesystem sandbox. The provider returns text in the same managed Task, not a second application-state store. Network/await support is still separate unfinished work. See examples/async-file.endor; from REPL call reader.read("/absolute/path.txt") to update its actual TextBlock, even when that object is hidden but retained.