Skip to content

Make trio + telco templates compatible with PyRel 1.11#84

Merged
cafzal merged 3 commits into
mainfrom
worktree-stateful-scribbling-breeze
Jun 9, 2026
Merged

Make trio + telco templates compatible with PyRel 1.11#84
cafzal merged 3 commits into
mainfrom
worktree-stateful-scribbling-breeze

Conversation

@cafzal

@cafzal cafzal commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Bumps factory_production, supplier_reliability, cicd_runner_allocation, and telco_network_recovery to relationalai==1.11.0 and fixes the incompatibilities that surfaced.

Changes

  • Strip mismatched short_name= — PyRel 1.11 rejects a short_name= that differs from its LHS attribute at model-build ([Invalid short name]). Removed the 5 mismatched args in telco_network_recovery.py (performance_for_tower, cdr_caller, cdr_callee, cdr_routed_through, upgrade_for_tower); PyRel now derives each name from the attribute. Each value was used only in its own declaration. Every other short_name= in v1/ already matches its attribute and is left untouched.
  • Fix solve() signatureProblem.solve() now requires solver as a positional arg. telco's problem.solve() (which relied on the removed engine-default) → problem.solve("gurobi"), preserving the existing HiGHS fallback. The trio already used solve("highs", ...).
  • Pins — trio (==1.9.0) and telco (==1.8) → ==1.11.0; README SDK requirement lines aligned.

Validation

All four run end-to-end on relationalai==1.11.0, no [Invalid short name] errors:

  • telco — PIPELINE COMPLETE, plan $4,998,891 (24 towers, binding=budget)
  • factory_production — OPTIMAL, profit 200000 + sensitivity
  • supplier_reliability — OPTIMAL, obj 4850 + scenario analysis
  • cicd_runner_allocation — OPTIMAL baselines + intentional CONFLICT_FOUND/IIS demo

Bump factory_production, supplier_reliability, cicd_runner_allocation,
and telco_network_recovery to relationalai==1.11.0 and fix the
incompatibilities that surfaced.

- Strip mismatched short_name= in telco (PyRel 1.11 rejects a short_name
  that differs from its LHS attribute at model-build). Removed the 5
  mismatched args; PyRel now derives each name from the attribute. Every
  other short_name= in v1/ already matches its attribute and is untouched.
- Fix solve() signature: Problem.solve() now requires solver as a
  positional arg. telco's problem.solve() -> problem.solve("gurobi"),
  preserving the HiGHS fallback. The trio already used solve("highs", ...).
- Pins: trio (==1.9.0) and telco (==1.8) -> ==1.11.0; README SDK lines aligned.

Validated end-to-end on relationalai==1.11.0 with no [Invalid short name]
errors: telco pipeline complete, factory_production/supplier_reliability
OPTIMAL, cicd_runner_allocation baselines OPTIMAL + intentional conflict demo.
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

The docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-nuet26myl-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/81in4RUc11uWidFZspEYXg3iyuCw

The Gurobi-unavailable troubleshooting note still described the pre-1.11
'engine's configured solver picks up by default' behavior. Under 1.11 the
script explicitly requests gurobi first, so update the prose to match.

@chriscoey chriscoey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — clean, well-scoped 1.11 bump. I dug into the two real changes and ran the templates to confirm.

Verified

  • The short_name= removals are safe: in 1.11.0 relations are keyed by object identity, not by name string, so NetworkPerformance.for_tower and TowerUpgradeOption.for_tower both deriving the "for_tower" display name don't collide. The five removed values aren't referenced anywhere else in v1/.
  • solve() in 1.11.0 is def solve(self, solver: str, *, …)solver is positional-or-keyword, so the except fallback solve(solver="highs") is valid.
  • Ran the trio end-to-end on relationalai==1.11.0: factory OPTIMAL, profit 200000 + sensitivity; supplier OPTIMAL, obj 4850 + scenarios (-C=6750, -B=5150); cicd OPTIMAL baselines (0.5x/1.0x/1.5x = $10.18/$9.62/$9.53) + the intentional CONFLICT_FOUND/IIS. All match the PR description. I didn't stand up telco's full GNN pipeline locally (needs change-tracking + EXP_DATABASE), so I'm relying on your telco run for Stage 4 — its model build passes here, so the short_name change is fine.

Non-blocking nits (fine to merge as-is):

  1. telco_network_recovery/README.md:57 — the prerequisite bullet still says HiGHS fallback happens "if gurobi is not configured." With the new solve("gurobi"), fallback only fires when the engine raises a matching error, not when the engine is simply configured for HiGHS. The troubleshooting block at line 369 was updated to match; this earlier bullet reads stale. Maybe: "if gurobi is unavailable or unlicensed, the script catches the solver error and falls back to HiGHS automatically."
  2. The fallback filter (telco_network_recovery.py:892) keys on the substring "unavailable" but not "not available", and it now runs on every gurobi-unconfigured solve rather than only genuine license failures — and it's the one branch neither run exercised (yours solved on gurobi, my trio runs don't touch telco). Worth a glance that your engine's gurobi-missing message actually matches the keyword set, else the else: raise hard-fails instead of falling back.
  3. Minor: the comment at telco_network_recovery.py:882 ("engine-configured for licensed deployments") reads slightly stale now that the call passes "gurobi" literally rather than deferring to engine config.
  4. Optional: the inline solve(sensitivity=True) / solve(conflict=True) shorthand in the trio READMEs isn't literally runnable under 1.11 (missing the now-required solver) — reads fine as illustrative shorthand, your call whether to tighten.

Nice cleanup.

The Gurobi-fallback branch keyed on a hand-listed keyword set (missing
'not available' among others) and, with solve("gurobi") now requesting
gurobi on every run, was the one path neither validation run exercised --
an unmatched gurobi-missing message would hit 'else: raise' and hard-fail.
Catch any gurobi solve failure and retry HiGHS instead; if HiGHS also
fails (e.g. a genuine model issue) that error propagates. Verified both
paths end-to-end: gurobi happy path and a forced-failure fallback both
reach the same OPTIMAL plan.

Also align the stale prerequisite bullet (README:57) and the solve-block
comment with the explicit solve("gurobi") call.
@cafzal
cafzal merged commit c761137 into main Jun 9, 2026
3 checks passed
@cafzal
cafzal deleted the worktree-stateful-scribbling-breeze branch June 9, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants