Conversation
Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
|
@copilot ples (3.9) ====================================================================== Failed Examples: ====================================================================== |
…ueries Modified should_apply_compositional_uq() to exclude selection queries (order_by + limit without aggregate). These should use SelectionUQ framework, not compositional UQ. Fixes example_selection_uq_topk.py failure. Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Fixed in commit 8799e5f. Issue: Compositional UQ was incorrectly intercepting SelectionUQ queries (top-k without aggregation). Solution: Modified
The |
Compositional UQ Implementation - COMPLETE ✅
This PR implements compositional uncertainty quantification for the py3plex DSL, enabling UQ to flow through complete query pipelines (not just compute operations).
Latest Fix (commit: TBD)
Issue: CI failure in
example_selection_uq_topk.py- compositional UQ was incorrectly intercepting SelectionUQ queries.Root cause:
should_apply_compositional_uq()returned True for any query withorder_by, including selection queries (top-k without aggregation) that should use SelectionUQ.Fix: Modified routing logic to exclude selection queries:
order_by + limitWITHOUT aggregate → use SelectionUQlimit_per_group→ use SelectionUQNow the example works correctly by routing to SelectionUQ framework.
Implementation Summary
Core Architecture:
py3plex/dsl/compositional_uq.pymodule with UQ primitivespy3plex/dsl/executor.pywith compositional UQ executionnumpy.random.SeedSequenceDelivered Capabilities:
Documentation:
example_dsl_compositional_uq.py)test_dsl_compositional_uq.py)Testing Coverage:
Key Features
1. Aggregate with Uncertainty:
2. Top-K with SelectionUQ (unchanged, now properly routed):
3. Ranking Stability with Aggregate:
Design Principles
Files Changed
New Files:
py3plex/dsl/compositional_uq.py(361 lines)tests/test_dsl_compositional_uq.py(230 lines)examples/network_analysis/example_dsl_compositional_uq.py(133 lines)COMPOSITIONAL_UQ_SUMMARY.md(documentation)Modified Files:
py3plex/dsl/executor.py(+333 lines) - compositional UQ integrationpy3plex/dsl/compositional_uq.py(routing fix)AGENTS.md(+200 lines) - section 9.3 documentationConclusion
This implementation delivers on the core requirements with proper routing between SelectionUQ and compositional UQ frameworks.
Original prompt
This section details on the original issue you should resolve
<issue_title>uq e2e</issue_title>
<issue_description>
You are implementing a major upgrade to py3plex DSL (v2 builder API + legacy string frontend) so that uncertainty quantification (UQ) is truly compositional across the full query pipeline — not just a bolt-on resampling wrapper around compute(). The goal is: “any statistic the DSL can produce can also be returned with uncertainty (std/CI/quantiles) in a principled, deterministic, provenance-rich way.”
You MUST follow the project’s agent-facing design in AGENTS.md:
DELIVERABLES:
================================================================================
A. REQUIRED USER-FACING BEHAVIOR (NO BREAKING CHANGES)
A1. Existing behavior remains unchanged when UQ is not enabled.
A2. When UQ is enabled, uncertainty must “flow through” the pipeline:
A3. DSL string frontend must gain parity:
Pick one, implement minimally, document, and test.
================================================================================
B. SEMANTICS: WHAT DOES “COMPOSITIONAL UQ” MEAN?
Define a clear semantic model and implement it:
B1. Resampling interpretation
B2. Where uncertainty is computed
B3. Determinism guarantees
================================================================================
C. REQUIRED NEW CAPABILITIES
C1. UQ for summarize()/aggregate()
Implement uncertainty for:
For each summary expression (e.g., mean(degree), quantile(weight,0.95), count()):
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.