# CLI Trace

Date: 2026-05-13

Working folders:

- sim project: `C:\Users\jiwei\Documents\GitHub\sim-proj\dev-docs\comsol-hbm-hbn-repro`
- COMSOL plugin: `C:\Users\jiwei\Documents\GitHub\sim-plugin-comsol`
- sim runtime: `C:\Users\jiwei\Documents\GitHub\sim-cli`

## COMSOL Availability

```powershell
$env:PYTHONIOENCODING='utf-8'
.\.venv\Scripts\python.exe -m sim check comsol
```

Key output:

```text
[sim] check: comsol
  detected 1 installation(s):
  - comsol 6.4
      path: C:\Program Files\COMSOL\COMSOL64\Multiphysics
      profile: comsol_64_mph_1
```

## Runtime Alignment

The local COMSOL plugin venv had an older `sim connect` command without `--driver-option`.
The newer `sim-cli` source venv had the option but no COMSOL plugin registered.
I installed the local COMSOL plugin into the sim-cli venv:

```powershell
uv pip install --python .\.venv\Scripts\python.exe -e ..\sim-plugin-comsol
```

Key output:

```text
Installed 4 packages
 + jpype1==1.7.1
 + mph==1.3.1
 + numpy==2.4.4
 + sim-plugin-comsol==0.1.13
```

## Shared Desktop Session

```powershell
.\.venv\Scripts\python.exe -m sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
```

Session ID:

```text
b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f
```

Health check:

```powershell
.\.venv\Scripts\python.exe -m sim --session b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f inspect session.health
```

Key output:

```json
{
  "effective_ui_mode": "shared-desktop",
  "ui_capabilities": {
    "model_builder_live": true,
    "shared_desktop": true
  },
  "active_model_tag": "Model1",
  "live_model_binding": {
    "ok": true,
    "bound_model_tag": "Model1"
  }
}
```

## Checkpointed Model Execution

Identity checkpoint:

```powershell
.\.venv\Scripts\python.exe -m sim --session b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f exec --file ..\sim-proj\dev-docs\comsol-hbm-hbn-repro\scripts\10_identity.py --label hbm-hbn-identity
```

Geometry selection probe:

```powershell
.\.venv\Scripts\python.exe -m sim --session b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f exec --file ..\sim-proj\dev-docs\comsol-hbm-hbn-repro\scripts\20_geometry_probe.py --label hbm-hbn-geometry-probe
```

Key output:

```text
component_selections:
geom1_blk_sub_dom
geom1_blk_int_dom
geom1_blk_gpu_dom
geom1_blk_lid_dom
```

Boundary selection probe:

```powershell
.\.venv\Scripts\python.exe -m sim --session b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f exec --file ..\sim-proj\dev-docs\comsol-hbm-hbn-repro\scripts\22_boundary_selection_probe.py --label hbm-hbn-boundary-selection-probe
```

Key output:

```text
top boundary entities: [11]
bottom boundary entities: [3]
```

Material/TDP/thickness runs used `scripts/30_build_solve_baseline.py` plus selector files in `input/`.

Example:

```powershell
Set-Content input\current-interposer.txt hbn
Set-Content input\current-interposer-thickness-um.txt 300
Set-Content input\current-gpu-power-w.txt 100
.\.venv\Scripts\python.exe -m sim --session b68f93bc-c84f-4ae4-8bb2-6d9a0ab40f6f exec --file scripts\30_build_solve_baseline.py --label hbn-p100w-t300um
```

## Result Summary

At `300 um` interposer thickness:

| GPU power | h-BN Tmax | Si Tmax | h-BN minus Si |
|---:|---:|---:|---:|
| 100 W | 1035.274 °C | 1040.276 °C | -5.002 °C |
| 200 W | 2050.549 °C | 2060.552 °C | -10.003 °C |
| 300 W | 3065.823 °C | 3080.828 °C | -15.005 °C |

h-BN thickness sweep at `100 W`:

| h-BN thickness | Tmax |
|---:|---:|
| 100 um | 1039.062 °C |
| 200 um | 1036.526 °C |
| 300 um | 1035.274 °C |
| 500 um | 1034.155 °C |

Interpretation: the representative COMSOL model reproduces the qualitative trends from the paper, but not calibrated absolute temperature values. Exact replication needs author-supplied geometry, mesh, and boundary-condition details.

## Video Polish Pass

The first web demo video changed pages too quickly and used oversized explanatory text. The revised version keeps only two paper frames, slows each slide hold to roughly twice the original duration, shrinks the typography, and gives the COMSOL screenshots most of the frame.

Workflow issue encountered while regenerating the MP4: the default `python` on this workstation could build the GIF with Pillow, but did not have `imageio` for MP4 encoding. I regenerated the video through an isolated `uv run --with imageio --with imageio-ffmpeg --with pillow --with numpy ...` command instead of changing the global Python environment.

## Second Video Recut

The second pass collapses the paper context to one combined frame so viewers reach COMSOL faster. It adds more COMSOL/CLI/result frames and uses lightweight pan/zoom, spotlight outlines, and a terminal cursor overlay in the MP4 generator. The GIF remains a small keyframe fallback, while the MP4 carries the dynamic screencast feel.
