跳转到主要内容

这是本节的多页打印视图。 .

返回本页常规视图.

Blog

按版本归档 tasklane 的演进历史、协议变更与升级兼容性说明。

本栏目归档 tasklane 从首个预发布版(0.1.0-beta.1)至当前版本(0.2.0)的完整变更记录。各篇记录的发布日期与原始条目均同步自运行时仓库的 CHANGELOG.md。

升级提示:当版本变更涉及 Worker 协议升级(如 0.2.0-beta.2 引入协议 v7)时,请务必将主线程依赖与独立打包的 Worker 产物作为同一个发布单元同步升级。关于当前最新版本的用法与接口定义,请直接查阅在线文档与API 参考。

1 - 变更日志

来自 tasklane 运行时仓库 CHANGELOG.md 的历次版本发布记录。

以下按发布时间倒序归档 tasklane 各版本的中文导读摘要与英文原始变更记录。

1.1 - 0.2.0

首个正式版,基于 0.2.0-beta.2 发布,并将 npm 默认通道更新为 latest。

0.2.0 是 tasklane 的首个正式版,运行时行为与 0.2.0-beta.2 相同,继续使用 Worker 协议 v7。从较早协议版本升级时,请同时更新主线程包与独立打包的 Worker。

主要变化摘要

  • npm 的 latest 通道指向正式版,可用 npm install @mapseekai/tasklane 安装。
  • npm 包加入项目 logo,README 链接到独立文档站,并补充了架构文档。

原始记录

以下内容保留 tasklane CHANGELOG 中此版本的英文原文:

  • Promote 0.2.0-beta.2 to the first stable 0.2.0 release; no runtime behavior changes since beta.2.
  • Publish the package on npm’s latest channel and include the project logo in the package.
  • Link the documentation site and expand architecture documentation.

相关文档

1.2 - 0.1.0-beta.4

增强预算防饥饿保护与物理槽位协同,支持结果迭代器显式清理重试。

本版本重点加固了大任务预算防饥饿保护的触发条件,并为流式结果迭代器引入了显式的清理重试机制(retryCleanup())。

主要变化摘要

  • 精细化预算防饥饿保护:预算等待保护现在严格结合物理 Worker 槽位可用性与任务的有效优先级(含 ageing 老化提升后的优先级),仅在任务具备物理执行条件且等待满 budgetWaitMs 时锁定短缺额度。
  • 结果迭代器显式清理重试:iterateResults 新增 retryCleanup() 方法。当首次 close() 清理失败时保留初始失败状态供观测,同时支持调用方修复外部条件后安全地共享重试清理流程。
  • 扩充调度与清理回归测试:新增通用公平调度、Session 槽位占用、在途取消与资源异步清理的回归测试用例。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Budget starvation protection follows physical slot availability and effective task priority, including ageing.
  • Explicit result iterator cleanup retry with observable initial failure and shared in-flight cleanup.
  • Generic scheduling, Session occupancy, cancellation and cleanup regression coverage.

相关文档

1.3 - 0.2.0-beta.1

新增常驻资源租约、显式 Session 准入、两阶段可变分块、SessionGroup 选路与动态内存压力调节。

本版本引入了完整的动态资源调度与状态型多副本能力,涵盖常驻资源租约(ResourceLease)、显式 Session 准入、SessionGroup 缓存足迹路由、两阶段可变大小分块、交互资源预留(interactiveReserve)以及内存压力与自适应扩缩容。

主要变化摘要

  • 常驻资源与显式会话准入:新增 resources.acquire({ kind: 'resident', bytes }) 可调大小租约,以及支持 wait / immediate 模式的 scope.acquireSession() 与空闲可回收会话(reclaimable: true)。
  • 多副本 SessionGroup 与缓存遥测:支持通过 CacheResourceLease.report() 上报读取器内部块缓存快照与命中率,并在 SessionGroup 中按真实缓存足迹(Footprint)智能选路。
  • 两阶段可变大小分块:新增 createSizedResultSource 与 iterateSizedResults,先描述块大小上界、再按实际需求预留输出额度并读取数据。
  • 交互预留与定向阻塞唤醒:支持为 interactive 工作预留专用 Worker、活跃槽位、准备窗口、结果租约与字节预算;调度器对阻塞队列建立资源索引,实现定向唤醒。
  • 内存压力与可选自适应控制:支持 resizePool、setMemoryPressure、trim 以及池级 adaptive 控制器,所有缓存缩容均基于 Host ACK 确认后归还额度。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Scoped resident ResourceLease budgets, bounded handle counts and atomic resize.
  • Explicit Session admission with immediate/wait modes, cancellation and capacity diagnostics.
  • Opt-in idle Session reclamation with graceful disposal and physical capacity retention on failure.
  • Multi-key locality hints with bounded, scope-isolated successful-work history.
  • Resizable Worker cache resources and large TypedArray resident accounting.
  • Two-phase sized result streaming with pre-encoding output admission.
  • Explicit transferOwnedBuffers alias, public types and emap migration guidance.
  • Joint Worker/resident Session admission, pressure-driven replica reclaim and resize wakeups.
  • Failed Worker termination no longer blocks reclamation of healthy idle Workers.
  • Zero-copy binary cache view snapshots and cumulative per-pool/global cache counters.
  • Sized output metadata is encoded once, with announced and task bounds rechecked before sending.
  • Session admission retains ownership through reentrant factory cancellation and synchronous startup failures.
  • Session groups route among caller-opened replicas using bounded replacement reader footprints.
  • Optional interactive Worker, active/preparing, result-lease and byte reservations.
  • Resource-indexed blocked queues with targeted wakeups and eligibility counters.
  • Explicit pool resize, pressure/trim and reader trim callbacks with acknowledgement-based accounting.
  • Opt-in adaptive Worker/cache targets within hard bounds, with idle hysteresis and pressure suspension.
  • Reader cache counters/snapshots and per-pool reclamation attempts, failures and reasons.
  • Protocol v6 adds cache control and resource telemetry; update the main package and Worker bundle together.
  • Recheck idle replica eligibility after asynchronous cleanup to protect newly admitted work.
  • Defer adaptive cache changes on busy Workers and reconcile at idle without blocking other pools.
  • Deterministic multi-pool sampling, repeated pressure transitions and three-browser sustained lifecycle coverage.

相关文档

1.4 - 0.2.0-beta.2

引入协议 v7 数组按位置编码优化,修复维护唤醒、延迟缩容与防饥饿保护边界。

本版本将 Worker 通信协议更新至 v7,优化了普通数组的序列化开销,并加固了动态维护唤醒、延迟缩容、交互容量保护与自适应缓存重试等多项调度边界。

主要变化摘要

  • 协议 v7 数组按位置编码:普通数组的连续元素前缀不再保存下标字符串键,解码时原地恢复引用,同时完整保留稀疏数组空洞、自定义属性、对象图别名与特殊标量值。升级时需同步更新主线程包与 Worker 构建产物。
  • 完善 Blob / File 诊断与准备阶段说明:当附件超出限额时,错误消息明确包含已统计的附件字节数及需配置的 blobLimits 字段;明确调用线程准备窗口(maxPreparingTasks)与暂存边界。
  • 修复维护与回收后的队列唤醒:在动态维护结束或等待准入的主 Session 所属 Scope 关闭后,及时唤醒被占满池阻塞的任务与副本准入队列。
  • 加固延迟缩容与交互预留保护:在新任务准入前协调忙碌 Worker 的延迟缩容,严格保留必需 Session、结果租约、隔离 Worker 额度以及池内 interactiveWorkers 容量。
  • 修复预算防饥饿与自适应缓存重试:使非交互字节短缺的防饥饿保护与老化后的准入通道正确配合,并在高精度计时器提前触发时自动重装定时器;当扩容预算恢复时自动重试自适应缓存目标差额。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Encode array prefixes without string index keys and decode them in place, preserving holes, custom properties, graph identity and scalar values. Protocol v7 requires updating the main package and Worker bundle together.
  • Report the required Blob/File bytes and the input/output blobLimits field on budget failures; clarify caller-thread preparation, preparation windows and scratch/adaptive boundaries.
  • Wake full-pool task queues after maintenance and Session admission after a waiting primary owner closes.
  • Reconcile deferred Worker shrink before new admission, preserving required Sessions, result leases and physical termination credits.
  • Apply starvation protection to non-interactive byte shortages while preserving interactive reserved capacity, including separate admission-class lanes after ageing.
  • Resume lazy Session reclamation after a failed termination, retaining quarantined Worker credits while trying healthy victims.
  • Preserve interactive Worker headroom during immediate and deferred pool shrink, including reuse of existing Workers.
  • Retry adaptive cache target mismatches when growth budget returns, without repeating failed reservations while capacity is still held.
  • Rearm early budget-wait timers so fractional timer delays cannot disable starvation protection.

相关文档

1.5 - 0.1.0-beta.1

首个 beta 预发布版本:奠定跨平台 Worker 适配、Scope 生命周期、优先级调度、预算账本与 ResultLease 背压模型。

0.1.0-beta.1 是 tasklane 的首个公开预发布版本,确立了跨浏览器 Web Worker 与 Node.js worker_threads 的统一任务运行时架构。

主要变化摘要

  • 跨平台统一运行时与 Scope 生命周期:提供应用级 WorkerRuntime 与可嵌套的 RuntimeScope,支持基于 released ACK 的确定性资源清理屏障。
  • 有界优先级与公平调度:支持 interactive、foreground、background 三级优先级、可选老化提升(ageing)、group 组间公平索引堆调度以及大任务预算等待保护。
  • 显式数据所有权与结果背压:通过 transferBuffers() 与 output() 显式管理 ArrayBuffer 零拷贝转移;通过 inputBytes、scratchBytes、outputBytes、cacheBytes 账本与 ResultLease 实现端到端背压。
  • 取消模式、亲和性与状态型 Session:提供 cooperative、discard、terminate 三种取消模式,支持软亲和性(affinity)、独占 WorkerSession 以及按作用域隔离的本地 ScopedCache 与 ScratchArena。
  • 协议代际与全套验证矩阵:引入 Worker epoch 代际隔离、有界进度流控、阶段耗时统计(TaskTiming),并通过 Node.js 与三大浏览器的大规模坐标转换及取消风暴测试。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

First beta release of tasklane with:

  • browser Web Worker and Node.js worker_threads adapters
  • scoped lifecycle and bounded scheduling
  • priority, ageing and fair task admission
  • explicit Transferable ownership
  • input, scratch, output and cache budgets
  • ResultLease backpressure
  • cooperative, discard and terminate cancellation modes
  • worker affinity and stateful sessions
  • worker-local bounded caches
  • protocol generation and failure handling
  • runtime metrics and timing
  • browser, stress and large-data conversion verification

Reliability and scheduling

  • Indexed group scheduling, bounded fairness history and waiting-budget protection.

  • Physical phase validation, bounded progress with ACKs, and confirmed scope cleanup (protocol v3).

  • Explicit resident-resource disposal, discarded-result tasks, lease count limits and termination recovery.

  • Independent metadata traversal limits and a real-Worker scheduler benchmark.

  • Bounded wire packets account for scalar and graph metadata; results decode on consumption.

  • Synchronous-only prepare rejects hanging promises; asynchronous preparation belongs in Worker handlers.

  • Strict priority defaults, measured scratch arenas, and metadata-aware ordinary cache accounting.

  • Deterministic Node endpoint retirement tests and real Worker error/termination races.

相关文档

1.6 - 0.1.0-beta.2

新增受限 File/Blob 协议附件、每任务 blobLimits 限额以及拉取式文件 Session 示例。

本版本将通信协议推进至 v4(当前最新版本已演进至 v7),新增了跨浏览器与 Node.js Worker 的 File / Blob 附件传输支持及独立的附件逻辑字节限额。

主要变化摘要

  • 有界 File / Blob 附件表:支持在协议包中直接传递最多 256 个 Blob 或 File 附件,并在浏览器与 Node.js worker_threads 两端完整保留 File 的 name、type 与 lastModified 元数据。
  • 独立的每任务 blobLimits:将文件附件的逻辑字节大小限制(blobLimits.inputBytes / outputBytes,默认 0)与内存缓冲区协议预算分开校验,要求非空附件必须显式声明上限。
  • 补充文件分块与常驻 Session 指南:提供基于 Session 的按范围文件分块读取示例、大型二进制数值缓存技巧以及常驻 Session 容量规划说明。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Protocol v4: bounded Blob/File attachments with preserved File metadata across browser and Node workers.
  • Per-task logical input/output blob limits, separate from packet memory credits; attachments use structured cloning.
  • Tested pull-based file Session example, binary cache guidance and resident Session capacity planning.
  • Capability-focused usage, API and resource documentation.

相关文档

1.7 - 0.1.0-beta.3

新增 enqueuePrepared 异步输入准备、协议 v5 结构化远端错误与 iterateResults 公共拉取接口。

本版本将通信协议推进至 v5(当前最新版本已演进至 v7),引入了绑定 Worker 之前的受控异步输入准备阶段、结构化远端业务错误传递以及公共的分块结果迭代器。

主要变化摘要

  • 受预算约束的异步输入准备(enqueuePrepared):允许在分配物理 Worker 之前,先在调用线程通过 prepareAsync 执行受 maxPreparingTasks 窗口与 preparationScratchBytes 约束的异步 I/O 读取。
  • 结构化远端业务错误(remoteError):Worker 处理函数抛出的异常现在可保留有界的 name、code、message、stack 以及受深度和字节限制的 details 结构化元数据。
  • 公共分块结果迭代器(iterateResults):正式从主包导出拉取式消费迭代器,自动保证在释放上一块 ResultLease 后再请求下一块,并提供确定性的游标与作用域关闭屏障。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Protocol v5: structured, bounded remote business error metadata.
  • Budgeted asynchronous input preparation before Worker admission.
  • Public result iteration with deterministic lease and cursor cleanup.
  • Simplified task completion state and shared test/benchmark helpers.

相关文档