发布

  • fix(core): batch hashing, topological cache walk, and TUI batch fixes (#34798)

    frostbyte_neo 发布于 2026-03-13 13:26:41 +00:00

    Current Behavior

    • hashBatchTasks hashes tasks one-by-one via Promise.all +
      hashTask (singular), making N separate native hasher calls.
    • Batch cache resolution rebuilds the entire remaining task graph each
      wave via removeTasksFromTaskGraph, which is O(tasks) per wave and can
      crash if graph.dependencies[id] is undefined.
    • postRunSteps for cached batch results is deferred until all cache
      resolution completes.
    • TUI batch groups appear below "Waiting for task..." placeholders
      because their status is based on nested task statuses, which may not
      have transitioned yet.

    Expected Behavior

    • hashBatchTasks uses hashTasks (plural) to batch all tasks into a
      single native hasher call.
    • Batch cache resolution uses a new walkTaskGraph util that walks
      topologically via in-degree counters — only visits direct dependents per
      wave instead of rebuilding the graph.
    • postRunSteps runs incrementally per wave during cache resolution.
    • TUI batch groups are treated as in-progress by existence (since
      start_batch was called), only moving to completed when all nested
      tasks are done.

    Related Issue(s)

    Fixes crash: Cannot read properties of undefined (reading 'filter') in
    removeIdsFromTaskGraph during batch cache resolution.


    Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>

    下载附件