Skip to content

Fix DSL UQ ergonomics and harden quickstart CI apt install step#1354

Merged
SkBlaz merged 6 commits intomasterfrom
copilot/check-dsl-ergonomics
Apr 23, 2026
Merged

Fix DSL UQ ergonomics and harden quickstart CI apt install step#1354
SkBlaz merged 6 commits intomasterfrom
copilot/check-dsl-ergonomics

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Query-level .uq(...) was leaking into metrics that were explicitly configured as deterministic via compute(..., uncertainty=False). This broke expected per-metric override behavior in mixed deterministic/uncertainty queries.

  • Per-metric UQ override semantics

    • Added explicit override tracking on compute items with a tri-state field:
      • None: not specified at metric level
      • True: explicitly enabled
      • False: explicitly disabled
    • This distinguishes default behavior from an intentional opt-out.
  • UQ resolution precedence fix

    • Updated UQ resolution to treat uncertainty_explicit=False as an explicit metric-level opt-out from query-level .uq(...) when no metric-level UQ params are provided.
    • Preserved existing behavior where metric-level UQ params (e.g. method, n_samples) still take precedence.
  • Code-level clarity

    • Documented tri-state semantics directly in AST and resolver comments to make precedence behavior explicit for future maintenance.
  • CI hardening (from PR feedback)

    • Updated .github/workflows/tutorial-validation.yml to reduce apt mirror flakiness in Install system dependencies:
      • configured apt retries (Acquire::Retries "3")
      • configured apt HTTP/HTTPS timeouts (Acquire::http::Timeout "30", Acquire::https::Timeout "30")
      • forced noninteractive apt mode
      • used --no-install-recommends
      • increased step timeout from 5 to 10 minutes
result = (
    Q.nodes()
     .uq(method="perturbation", n_samples=10, seed=42)   # query-level default
     .compute("degree")                                   # uncertain
     .compute("clustering", uncertainty=False)            # explicit deterministic override
     .execute(net)
)

@SkBlaz
Copy link
Copy Markdown
Owner

SkBlaz commented Apr 23, 2026

@copilot The failure is in “Install system dependencies” and is caused by apt-get update hanging on Ubuntu mirrors until the step’s 5-minute timeout is hit:

Recommended fix

Make apt non-interactive, add retries/timeouts, and increase that step timeout slightly.

- name: Install system dependencies
  run: |
    sudo mkdir -p /etc/apt/apt.conf.d
    echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
    echo 'Acquire::http::Timeout "30";' | sudo tee /etc/apt/apt.conf.d/80-timeout
    echo 'Acquire::https::Timeout "30";' | sudo tee -a /etc/apt/apt.conf.d/80-timeout

    sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
    sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
      gcc g++ build-essential
  timeout-minutes: 10

Optional optimization (best for this workflow)

You likely don’t need this step at all for quickstart validation (manylinux wheels usually cover numpy/scipy on 3.8/3.10/3.12). If your examples don’t compile native extensions, remove the whole “Install system dependencies” step to avoid flaky network dependency entirely.

So the two practical paths are:

  1. Most robust/minimal CI flake risk: remove step 48–52.
  2. If compilers are needed: keep step but apply the hardened apt config above + longer timeout.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot The failure is in “Install system dependencies” and is caused by apt-get update hanging on Ubuntu mirrors until the step’s 5-minute timeout is hit:

  • Workflow: [`.github/workfl...

Applied the workflow hardening in .github/workflows/tutorial-validation.yml: added apt retries + HTTP/HTTPS timeouts, switched apt calls to noninteractive mode, used --no-install-recommends, and increased the step timeout to 10 minutes. Commit: 1ab4cc8.

Copilot AI changed the title Fix DSL UQ ergonomics: honor explicit per-metric uncertainty=False over query-level .uq() Fix DSL UQ ergonomics and harden quickstart CI apt install step Apr 23, 2026
Copilot AI requested a review from SkBlaz April 23, 2026 02:51
@SkBlaz SkBlaz marked this pull request as ready for review April 23, 2026 21:03
@SkBlaz SkBlaz merged commit b255c28 into master Apr 23, 2026
37 checks passed
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.

2 participants