You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v0.3.0-alpha.19: resolve var_ids before pulling samples
Fixes bug #23 discovered while end-to-end testing alpha.18 on a real
workbook. After a fresh run_simulation, get_sensitivity_ranking
returned empty on the first call and full ranking on the immediate
retry. Diagnostic: output lookup succeeded, output samples loaded,
then every input lookup against the same handle returned None.
Contract finding about MRService.dll: MRLIB_GetModelData appears to
leave the handle in a state where subsequent MRLIB_GetModelVarID
calls return None. The call sequence within one open handle must be
all GetModelVarID calls first, then all GetModelData calls.
Interleaving is unsafe.
Fix: every reader that interleaves lookups with sample fetches now
resolves all var_ids first, then pulls samples. Touches:
- ResultsReader.get_sensitivity_ranking
- ResultsReader.get_simulation_results
- ResultsReader.get_correlation_matrix
get_samples (single name, single fetch) is fine as-is.
Verified live: first sensitivity-ranking call on NPV_of_a_capital
_investment complete.xlsx now returns 6 driver entries (top driver
Market growth, r = +0.72) instead of an empty list.
399 unit tests still pass — the regression test is the integration
smoke run since the bug only manifests against the real DLL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,28 @@ All notable changes to ModelRisk MCP. Follows [Keep a Changelog](https://keepach
4
4
5
5
## [Unreleased]
6
6
7
+
## [0.3.0-alpha.19] — 2026-05-22
8
+
9
+
Fixes the bug-#23 lookup-after-samples regression discovered while end-to-end testing alpha.18 against a real workbook: `get_sensitivity_ranking` returned empty on the first call after `run_simulation`, then worked on the second identical call. The diagnostic trace was unambiguous — the output looked up fine, its samples loaded, then every input lookup against the same handle returned None.
10
+
11
+
### Fixed
12
+
13
+
-**MRLIB_GetModelData poisons subsequent MRLIB_GetModelVarID calls on the same handle.** Resolution: every reader that interleaves name lookups with sample fetches now resolves ALL var_ids first, THEN pulls samples. Applies to:
14
+
-`ResultsReader.get_sensitivity_ranking` — was failing on the first call after a fresh simulation (output looked up, output samples loaded, all inputs then refused to resolve). Now: output lookup → all input lookups → all sample fetches → ranking.
15
+
-`ResultsReader.get_simulation_results` — same risk on multi-output calls. Same fix.
16
+
-`ResultsReader.get_correlation_matrix` — same risk on multi-name correlation requests. Same fix.
17
+
-`ResultsReader.get_samples` (single name, single fetch — no change needed).
18
+
19
+
This is a *contract* finding about MRService.dll: the call sequence within one open handle must be all `GetModelVarID` calls first, then all `GetModelData` calls. Inverting them or interleaving is unsafe. Worth flagging upstream to the ModelRisk SDK team — and worth knowing for any future readers that touch the same surface.
20
+
21
+
### Why this matters end-to-end
22
+
23
+
Without alpha.19, the user's first sensitivity-ranking call after a sim returned silently empty. The LLM would tell them "no drivers detected" — completely wrong on a model that clearly has Spearman correlations up to +0.72. After alpha.19 the first call works correctly. Verified live against the `NPV_of_a_capital_investment complete.xlsx` workbook: 6 driver entries returned, top driver Market growth (r = +0.72), bottom three in noise territory.
24
+
25
+
### Tests
26
+
27
+
399 unit tests still pass — the bug only manifests against the real DLL, so the regression test is the integration smoke run.
28
+
7
29
## [0.3.0-alpha.18] — 2026-05-22
8
30
9
31
Targeted experiment for the empty-`.vmrs` blocker surfaced by alpha.17's post-condition verification. The bridge correctly detected that `VoseStartSimulCustom12 + VoseGetDataSZ12` was producing `.vmrs` files with zero registered outputs — sim ran, file existed, but no variable metadata. Ribbon-driven simulations on the same workbook worked fine, suggesting the ribbon path threads an option the headless XLL path skipped.
0 commit comments