Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
  • Trust and Verification14
  • Using AI for Engineering Work17
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
  • Agent Design8
    • Define the Task and Boundaries
    • Design the Architecture
    • Build Safe Read-Only Tools
    • Control the Decision Loop
    • Record State and Hand Over
    • Handle Errors and Budgets
    • Build the Starter Controller
    • Evaluate Your Assistant
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹Agent Design
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Agent Design
  4. Control the Decision Loop

Agent Design · Beginner

Control the Decision Loop

Choose one bounded action at a time and stop with an honest status.

On this page

    The Problem: A Plausible Next Step Forever

    An assistant can always suggest another search. That is not a useful stopping rule. A bounded loop must distinguish gathering new evidence, repeating a request, requesting handover, failing a boundary check, and exhausting a resource. For this course, one step means one chooser invocation. A stop request consumes a step because producing it still required a decision. The default eight-step budget therefore permits at most eight proposals, not eight tools followed by an unlimited conversation.

    One Proposal, One Check, One Observation

    At each turn the controller constructs a view of recorded evidence and unknowns, asks the chooser for exactly one action, validates that action, and either stops or dispatches one allowed tool. It then checks the deadline and result size before appending evidence. A tool result becomes available only on a later choice. This creates a clear boundary for replay: a reviewer can point to the precise observation that was available when each proposal was made.

    Eight-node conceptual loop shows copied state, budget checks, a single action, validated reading, evidence feedback, and explicit stopping. Deadline checks remain cooperative.
    The next choice sees accepted evidence; stop, error, repetition, or a budget ends the loop.

    The baseline chooser does not adapt to observations. It uses the evidence count to select three fixed requests and then stop. This demonstrates the controller interface but is a deterministic workflow, NOT a true LLM agent. A real agent would use a model's interpretation of returned evidence to choose among permitted actions. Whether that freedom is beneficial must be measured; the baseline remains a useful comparator because it has predictable coverage and no inference cost.

    Worked Synthetic Trace

    Choice

    Proposal

    Controller outcome

    1

    Search R42 for reset_smoke

    Record E1 with both matching log lines

    2

    Read reset_release from spec revision 3

    Record E2 with the requirement excerpt

    3

    Read three reset_smoke history records

    Record E3 with R40, R41, R42

    4

    Stop

    Return handoff_requested, preserving unknowns

    This trace is a specified example, not output captured from an execution. The terminal status is handoff_requested, not root_cause_found or design_verified. The controller can verify that a valid stop request arrived. It cannot infer that the evidence is sufficient for engineering closure. An evaluator separately checks whether the packet contains the required observations. If a chooser stops immediately, the program still returns a handover status, but that run should fail the evidence-completeness rubric.

    Repeated actions are detected by serializing the complete action with sorted keys. Different dictionary insertion order cannot disguise the same request. Changing a query can produce a distinct request, so repeat detection alone does not bound all loops. The step budget still caps the run. Because the lab data is immutable, immediately repeating an identical read cannot produce fresh evidence. A future live data source would need explicit snapshot and freshness semantics before deciding which repeated reads are meaningful.

    Exercise and Expected Checks

    Manually trace the baseline with max_steps=2. Record the status, evidence references, and missing source. Then trace a chooser that always requests the same first search. Do not assume an error is a successful search with zero results: an invalid request should create an error event and stop. Finally explain what a model should do if the available evidence does not resolve whether the failing cycle matches the specification's first rising edge.

    Check yourself What happens after two baseline steps, and after two identical search proposals?

    The two-step baseline returns step_budget with E1 and E2 but no history. An always-repeat chooser records E1, then stops with repeated_action on its second proposal. Unresolved timing alignment remains an unknown for handover.

    Limits and Source

    A loop boundary is only as strong as its operations. A chooser that never returns prevents a synchronous loop from reaching its next check. The lab's clock checks therefore implement a cooperative deadline, not forced cancellation. Python 3.12 time.monotonic provides elapsed-time measurement unaffected by wall-clock adjustments; external I/O still needs independent timeout enforcement.

    Related topics

    • Up: Agent Design

    • Next: Record State and Hand Over

    Previous

    108 / 173

    Next: Record State and Hand Over

    Up next

    Up nextRecord State and Hand Over

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Define the Task and Boundaries
    • Design the Architecture
    • Handle Errors and Budgets