noCV
SRUNTIME-105 · Control resources and concurrency

Stop infinite programs with a deterministic instruction budget

Practice briefTaskAdvanced

A backward jump with an always-true condition consumes a worker indefinitely.

Focused work estimate
4h + prerequisites
Priority in the scenario
High
Engineering practice
Resource metering · Determinism

Estimated field mix

  • Systems programming60%
  • Security40%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional rules engine executes a tiny arithmetic bytecode over synthetic integers. Its interpreter trusts jump offsets and can run forever. Build a local Rust runtime; it has no filesystem, network, dynamic loading, host calls, or candidate-source execution.

Setup prerequisites

  • Stacks
  • Instruction decoding
  • Control flow

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Caller supplies a positive maximum instruction count
  • Every executed instruction consumes budget
  • Exhaustion returns current offset and no successful result

Implementation constraints

  • Wall-clock timeout can be defense in depth but is not the deterministic oracle.

Verification to include

  • Run a terminating loop at exactly the declared budget.
  • Run an infinite loop and verify failure at the same step in repeated executions.

Deliverables

  • Instruction metering and loop-bound tests

Rollout and recovery

Begin with a conservative budget and expose exhaustion separately from invalid bytecode.

Value of the work

For the engineer: Practice runtime invariants, validation, resource accounting and compatibility.

For the team: Review a constrained execution component whose malformed programs fail deterministically without gaining host capabilities.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.