fuyu12345/terminalgen-skills/dask-futures-as-completed-hard

Claude Code and agent skill by fuyu12345/terminalgen-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Process heterogeneous async workloads in completion order using futures, while preserving full accounting and summary metrics. Use when tasks have variable runtimes, partial failures are expected, and output must prove non-blocking concurrency.

Install

npx vskill@latest install fuyu12345/terminalgen-skills/dask-futures-as-completed-hard

SKILL.md

The same SKILL.md was published earlier as fuyu12345/terminalgen-skills/dask-futures-as-completed-hard.

Processing Futures as Completed

When to Use

Use this skill when a pipeline currently waits for all futures (or processes in submission order) and needs to:

  • Consume results as soon as each task finishes
  • Avoid slow-task head-of-line blocking
  • Tolerate per-item failures without stopping the batch
  • Produce strict aggregate outputs (counts, timing, async-efficiency metric)

This pattern was validated across 3 independent runs with 1000 tasks and mixed latencies (0.1–3.0s), consistently passing runtime and correctness checks.

Minimal Reliable Workflow

  1. Inspect generator and worker contracts first.

Identify input schema, task count, expected failure behavior, and per-item runtime distribution.

  1. Submit all work to an executor with bounded concurrency.

Use ThreadPoolExecutor(max_workers=...) for IO/sleep-heavy tasks. Keep future -> submission_index metadata for completion-order analysis.

  1. Consume with `concurrent.futures.as_completed(...)`.

Iterate futures in completion order (not submission order). This is the core fix over wait(..., ALL_COMPLETED) bottlenecks.

  1. Handle result/exception per future immediately.
  • On success: increment total_processed
  • On expected validation failure: increment total_failed
  • On unexpected exception: increment total_failed and continue
  1. Track async-efficiency metric during completion loop.

Compute deviation using completion rank vs submission index (e.g., absolute difference), then average over all tasks. Positive value proves out-of-order completion.

  1. Enforce no-loss accounting guard.

Assert total_processed + total_failed == expected_total; raise if mismatched.

  1. Emit required JSON only.

Write /workspace/results.json with required fields and numeric types:

  • total_processed
  • total_failed
  • processing_time_seconds
  • average_completion_order_deviation

Common Pitfalls

  • Using `wait(..., ALL_COMPLETED)` then processing results afterward.

Observed root issue in the broken implementation; defeats completion-order handling and increases bottleneck risk.

  • Not mapping futures to submission metadata.

Without future -> submission_index, you cannot compute completion-order deviation correctly.

  • Letting exceptions abort the run.

Expected validation failures must be counted, not fatal; otherwise totals won’t hit expected count.

  • Missing final accounting assertion.

Runs can appear “successful” while silently dropping entries unless processed + failed == total is checked.

  • Terminal orchestration mistakes during long runs (bench/harness context).

In one trajectory, command concatenation/interruption caused results.json not to exist despite correct code. Prevent by waiting for process completion before issuing follow-up commands.

Verification Strategy

Run the solution end-to-end, then verify exactly what tests assert:

  1. Execution sanity
  • python /workspace/solution.py exits cleanly.
  1. Artifact checks
  • /workspace/results.json exists.
  • JSON parses.
  1. Schema checks
  • Required keys exist.
  • Field types are numeric where expected.
  • No negative values.
  1. Correctness constraints
  • total_processed + total_failed == 1000
  • processing_time_seconds < 60
  • average_completion_order_deviation > 0
  • Success/failure split remains reasonable (not pathological).
  1. Performance confidence
  • If close to timeout, increase worker count moderately and re-run.
  • Reconfirm accounting and deviation remain valid after tuning.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/fuyu12345/terminalgen-skills/dask-futures-as-completed-hard/badge)](https://verified-skill.com/skills/fuyu12345/terminalgen-skills/dask-futures-as-completed-hard)

Something wrong with this skill or its page? Tell us.