Skip to content

Implement Deterministic Analysis Pipelines with Offline Support#586

Open
Saura-4 wants to merge 4 commits into
FOSSEE:eSim-Chat-Bot-Semester-Long-Internship_Autumn-2025from
Saura-4:esim-ai-assistant-netlist-error-pipeline
Open

Implement Deterministic Analysis Pipelines with Offline Support#586
Saura-4 wants to merge 4 commits into
FOSSEE:eSim-Chat-Bot-Semester-Long-Internship_Autumn-2025from
Saura-4:esim-ai-assistant-netlist-error-pipeline

Conversation

@Saura-4

@Saura-4 Saura-4 commented Jul 4, 2026

Copy link
Copy Markdown

Implement Deterministic Analysis Pipelines with Offline Support

Overview

This PR introduces deterministic preprocessing pipelines for SPICE netlists and NgSpice simulation logs before AI-assisted analysis.

Instead of relying on a language model to interpret raw technical text, the AI Assistant now receives structured circuit information extracted directly from generated netlists and simulator output. Deterministic preprocessing handles tasks such as circuit parsing, component extraction, topology identification, and error analysis, while the LLM is focused on explanation and user interaction.

The same deterministic analysis pipeline is also reused to provide an offline analysis mode, allowing users to access structured circuit analysis and troubleshooting guidance even when an Ollama backend or local LLM is unavailable.

Additionally, this PR standardizes the application branding by renaming eSim Copilot to eSim AI Assistant throughout the project.

Note

This PR includes and extends the work previously proposed in PR #582. The implementation has been rebuilt on top of the latest eSim-Chat-Bot-Semester-Long-Internship_Autumn-2025 branch with a clean commit history and additional offline support.


Commit Structure

This PR is organized into four logical commits:

  1. Deterministic Netlist Analysis Pipeline
  2. Deterministic NgSpice Error Analysis Pipeline
  3. Rename eSim Copilot → eSim AI Assistant
  4. Standalone Offline Analysis Support

Key Changes

1. Deterministic Netlist Analysis

  • Added src/chatbot/netlist_analysis.py for deterministic SPICE netlist parsing.
  • Extracts structured circuit information including:
    • Component values and units
    • Node connectivity
    • Simulation directives
    • Recognized circuit blocks
    • Subcircuit information
  • Generates structured summaries that are supplied to the AI Assistant instead of raw netlists.

2. Deterministic NgSpice Error Analysis

  • Added:
    • error_patterns.py
    • error_log_analysis.py
    • error_solutions.py
  • Detects common NgSpice simulation errors using deterministic pattern matching.
  • Ranks primary root causes while suppressing cascading secondary errors.
  • Generates structured troubleshooting guidance before AI-assisted explanation.
  • Resolves UI timing issues where simulation logs could occasionally be captured before console output completed.

3. Standalone Offline Analysis

  • Added offline_formatter.py.
  • Integrated offline reporting into the chatbot workflow.
  • Reuses the deterministic analysis pipeline to generate:
    • Circuit summaries
    • Component tables
    • Circuit block detection
    • Error diagnosis
    • Troubleshooting guidance
  • Provides meaningful circuit analysis even when no local AI model is installed.

4. eSim AI Assistant Standardization

  • Renamed eSim Copilot to eSim AI Assistant throughout the project.
  • Updated documentation, configuration, UI labels, and knowledge-base references.
  • Fixed dock lookup failures caused by inconsistent window naming.

Scope

This PR affects the AI Assistant workflow and related UI integration.

Modified components include:

  • Deterministic netlist analysis
  • Deterministic error analysis
  • Offline formatter
  • AI Assistant integration
  • UI branding and dock management

The following components remain unchanged:

  • eSim schematic editor
  • Netlist generation
  • NgSpice
  • Simulation engine
  • Circuit execution pipeline

Testing

The implementation was manually verified using representative circuits and common NgSpice error scenarios in both AI-assisted and offline modes.

The deterministic rule set is designed to be extensible and can be expanded to support additional circuit patterns and simulator errors in future updates.


Screenshots

Deterministic Netlist Analysis (AI-Assisted)

The deterministic preprocessing pipeline extracts structured circuit information before passing it to the LLM for explanation.

Figures 1–2: Single AI-assisted netlist analysis response (split across two screenshots due to response length).

Screenshot 2026-07-04 104555 Screenshot 2026-07-04 104608

Deterministic Error Analysis (AI-Assisted)

Structured error facts are extracted deterministically before being provided to the LLM for explanation and troubleshooting.

Figure 3: AI-assisted deterministic error diagnosis.

Screenshot 2026-07-04 104702

Standalone Offline Netlist Analysis

The following response is generated entirely by the deterministic analysis pipeline without invoking an LLM.

Figures 4–5: Single offline netlist analysis response (split across two screenshots due to response length).

Screenshot 2026-07-04 104427 Screenshot 2026-07-04 104444

Standalone Offline Error Analysis

The following response is generated entirely by the deterministic analysis pipeline without invoking an LLM.

Figures 6–7: Single offline error analysis response (split across two screenshots due to response length).

Screenshot 2026-07-04 104738 Screenshot 2026-07-04 104814

Saura-4 added 4 commits July 4, 2026 02:05
Introduce static netlist analysis to parse NgSpice circuit netlists deterministically without relying on LLM reasoning. Extract component values, circuit topology, exact node connectivity, and simulation setup directives into structured streaming Markdown tables.
…cause detection

Add structured root-cause identification for simulation failures. Include multi-root-cause extraction, transient loop regex fixes, typo detection via circuit fact injection, and deterministic tip boxes. Integrate netlist and error analysis pipelines into chatbot backend threads and UI.
…im AI Assistant

Refactor branding from 'Copilot' to 'eSim AI Assistant' across documentation, config files, knowledge base, and dock titles. Fix window dock lookup failures caused by naming mismatches. Update .gitignore to untrack local config and test projects.
…or troubleshooting

Introduce an offline formatting engine allowing users without Ollama or local LLM installations to receive formatted, deterministic static netlist analysis reports and error debugging solutions directly in the UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant