crates.sage_ir.solver.shared_final_result

One whiteboard frame has one final future output. A frame owns the producer for one canonical atomic goal, and all requesters subscribe to that work. Candidate-local and frame-level progress are revisioned side information; they do not create extra future outputs or expose raw candidate state. Suspended continuations remain Rust futures, polled in bounded rounds.

Read in specification context · design/crates/sage_ir/solver.sage

Implementation

Implemented crates/sage-ir/src/check/solve/prove.rs:413–418

sage_ir::check::solve::prove · lib:sage_ir

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_ir.solver.shared_final_result`
pub(crate) fn solve_query<'db>(
    db: &'db dyn crate::Db,
    query: &Stashed<GoalQueryData<'db>>,
) -> Stashed<QueryResult<'db>> {
    let _solver_span = crate::db::InspectionSpan::new(

}

See more source ↗

TODO crates/sage-meta/tests/semantic_spec.rs:177–182

sage_meta::todo · test:semantic_spec

TODO: Bounded polling rounds and monotone intermediate publication remain planned. TODO: Complete the claim-specific verification matrix:

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_ir.solver.shared_final_result`
    // TODO: Bounded polling rounds and monotone intermediate publication remain planned.
    #[test]
    #[sage::test(crates.sage_ir.solver.shared_final_result)]
    fn solver_shared_final_result() {
        // TODO: Complete the claim-specific verification matrix:

}

See more source ↗

Tests and review

Indexed tests and the implementation-completeness and test-adequacy review; no test run is implied.

Implemented sage_ir::check::solve::prove::whiteboard_tests::same_parent_requests_share_one_live_producer_and_result

crates/sage-ir/src/check/solve/prove.rs · lib:sage_ir

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_ir.solver.shared_final_result)]
    fn same_parent_requests_share_one_live_producer_and_result() {
        with_crate(|db, krate| {
            let query = equality_query(krate, 0);
            let whiteboard = Whiteboard::default();
            let first = whiteboard.request(db, query.clone(), None, 0);
            let second = whiteboard.request(db, query.clone(), None, 0);
            assert_eq!(first.frame, second.frame);
            assert_eq!(
                whiteboard.inner.borrow().frames[first.frame.0 as usize]
                    .subscriptions
                    .len(),
                2
            );

            let (first, second) = whiteboard.drive(async move { (first.await, second.await) });
            assert_eq!(first, second);
            let reused = whiteboard.request(db, query, None, 0);
            assert!(reused.whiteboard.is_none());
            let reused = whiteboard.drive(reused);
            assert_eq!(first, reused);
            let inner = whiteboard.inner.borrow();
            assert_eq!(inner.frames.len(), 1);
            assert!(matches!(inner.frames[0].state, FrameState::Ready(_)));
            assert!(inner.frames[0].subscriptions.is_empty());
        });
    }
}

Conditional source: #[cfg(test)]

See more source ↗

TODO sage_meta::todo::solver_shared_final_result

crates/sage-meta/tests/semantic_spec.rs · test:semantic_spec

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_ir.solver.shared_final_result)]
    fn solver_shared_final_result() {
        // TODO: Complete the claim-specific verification matrix:
        // Duplicate requesters share one producer, receive an identical final response, and cannot
        // observe candidate-local state; progress snapshots strengthen monotonically; a self-waking
        // pending future is deferred to a later polling round and cannot starve sibling work.
    }
}

See more source ↗

Review: Accepted · Codex anchor_079 fresh CI review.

Independently inspected the fresh claim, both implementation entries, and both complete annotated tests from review start. Captured the containing solver model with review read. This is a source review; no tests were executed in this refresh, and root owns centralized execution. No source edits were made.

Requirements considered: one final output per frame; one owned producer for its canonical atomic query and shared subscriptions; revisioned candidate/frame side progress without extra future outputs or raw candidate exposure; Rust-future continuations with bounded polling rounds. The ordinary solve_query association captures prove.rs, including all whiteboard internals and the substantive test setup. Whiteboard::request reuses a frame by (query,parent,remaining_depth), creates a fresh subscription for pending work, and guards producer creation with producer_started and a single optional producer slot. Each producer owns its query and awaits solve_atomic_frame before returning its single (FrameId, Stashed<QueryResult>) output. complete requires Pending, stores Ready once, drains subscriptions and wakes waiters. ProofFuture::poll yields Pending while remembering the requester waker, or clones the final result; ready cache requests use immediate results. No subscription API exposes a candidate state or a progress output. ProducerFuture and prove_goal are pinned Rust futures, so suspended work is not reified into a separate continuation interpreter. Candidate processing remains internal to the producer; this assessment of the output boundary does not assert correctness of the separate unification, canonicalization or answer-reduction algorithms.

The ordinary same_parent_requests_share_one_live_producer_and_result test visibly constructs an atomic bool-equality query, creates two pending requests in the same context, asserts equal frame identity and two subscribers, drives both futures and asserts equal results. A later request must use the immediate cached result, equal to the original. It then asserts one frame, Ready state and no subscriptions. These assertions detect duplicate frames, divergent responses and incomplete subscriber cleanup. The with_crate/make_test_crate/equality_query setup helpers are all present in the initial whole-file snapshot, and contain setup rather than hidden behavioral assertions. This is meaningful coverage of the implemented shared-final-result subset.

The second implementation entry and solver_shared_final_result test are explicitly TODO. Their explanation defers bounded polling rounds and monotone intermediate publication. Current ProofFrame contains terminal state and subscriptions but no revisioned progress channel, and Whiteboard::drive drains the ready queue without a per-round bound. These requirements are not implemented by the mere use of Future. The TODO test has no assertions and is not counted as verification: it specifies remaining progress snapshots, candidate-local non-observation and self-waking fairness scenarios. Implementing the revisioned progress channel and bounded-round scheduling is the prerequisite for those tests; dedicated observation tests must then exercise that channel without exposing raw candidate state. Existing duplicate-request coverage now satisfies that portion of its broader intended matrix. The deferral remains visible and accepted as planned work, consistent with the containing solver model explicitly identifying scheduling as planned. No N/A evidence is present.

All requirements are accounted for by the implemented terminal-publication structure and substantive test, or the explicit justified TODO implementation/test evidence. No new behavioral concern or required source change was found in this refresh. Acceptance does not promote the deferred scheduling/progress behavior to implemented status.

Browse crates anchors

139 anchors

Specification anchors and declared coverage
AnchorImplementationTests
crates (139)114 Implemented37 TODO2 N/A74 Implemented107 TODO
crates.sage_inspector (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
crates.sage_inspector.inspection (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
balanced_tracesImplementedTODO
canonical_ownershipImplementedImplementedTODO
derive_reflectionImplementedImplementedTODO
detail_free_indexImplementedTODO
deterministic_traceImplementedTODO
durable_navigationN/ATODO
generic_browserN/ATODO
owned_reflectionImplementedImplementedTODO
product_availabilityImplementedTODO
revision_and_demandImplementedTODO
semantic_phase_boundaryImplementedTODO
source_evidenceImplementedTODO
typed_serviceImplementedTODO
unknown_workImplementedTODOTODO
workspace_actorImplementedTODO
crates.sage_ir (90)67 Implemented34 TODO40 Implemented88 TODO
crates.sage_ir.checking (12)12 Implemented3 TODO5 Implemented12 TODO
crates.sage_ir.checking.body (5)5 Implemented2 TODO3 Implemented5 TODO
elaborationImplementedImplementedTODO
expected_typesImplementedTODOTODO
interface_dependenciesImplementedImplementedTODO
isolated_completionImplementedImplementedTODO
operator_callsImplementedTODOTODO
identity_mintingImplementedTODO
owned_productsImplementedImplementedTODO
crates.sage_ir.checking.signature (4)4 Implemented1 TODO1 Implemented4 TODO
body_independenceImplementedTODO
narrow_detailImplementedTODOTODO
owner_binderImplementedImplementedTODO
storageImplementedTODO
symbol_keyed_interfacesImplementedTODO
crates.sage_ir.crate (9)9 TODO9 TODO
explicit_restrictionsTODOTODO
identity_before_detailTODOTODO
incremental_evidenceTODOTODO
narrow_demandsTODOTODO
reexecution_and_invalidationTODOTODO
represented_completenessTODOTODO
restrictions_and_gapsTODOTODO
semantic_query_boundariesTODOTODO
terminal_incompletenessTODOTODO
crates.sage_ir.inference (8)8 Implemented6 Implemented8 TODO
atomic_checkingImplementedImplementedTODO
body_local_quiescenceImplementedImplementedTODO
canonical_boundaryImplementedImplementedTODO
completed_body_boundaryImplementedTODO
numeric_domainsImplementedImplementedTODO
subtyping_and_coercionImplementedImplementedTODO
terminal_obligationsImplementedTODO
transaction_isolationImplementedImplementedTODO
crates.sage_ir.metadata (4)4 Implemented1 TODO4 TODO
explicit_incompletenessImplementedTODO
keyed_reuseImplementedTODOTODO
product_boundariesImplementedTODO
provider_authorityImplementedTODO
crates.sage_ir.modules (8)7 Implemented1 TODO4 Implemented8 TODO
crates.sage_ir.modules.expand (4)4 Implemented2 Implemented4 TODO
completenessImplementedImplementedTODO
dependenciesImplementedTODO
direct_membersImplementedTODO
recursion_and_fixpointImplementedImplementedTODO
crates.sage_ir.modules.parse (4)3 Implemented1 TODO2 Implemented4 TODO
dependenciesImplementedTODO
detail_firewallImplementedImplementedTODO
recovery_completenessTODOTODO
syntax_identitiesImplementedImplementedTODO
crates.sage_ir.resolution (5)5 Implemented1 TODO3 Implemented4 TODO
crates.sage_ir.resolution.lookup (5)5 Implemented1 TODO3 Implemented4 TODO
completenessImplementedTODOImplementedTODO
dependenciesImplementedTODO
expansion_import_ambiguityImplementedImplemented
identity_onlyImplementedTODO
precedenceImplementedImplementedTODO
crates.sage_ir.solver (9)7 Implemented7 TODO5 Implemented9 TODO
alternative_isolationImplementedTODOImplementedTODO
bounded_completenessImplementedTODOTODO
candidate_completenessImplementedTODO
canonical_cyclesTODOTODO
canonical_outputsImplementedImplementedTODO
local_index_firewallTODOTODO
normalization_demandImplementedTODOImplementedTODO
schedule_independenceImplementedTODOImplementedTODO
shared_final_resultImplementedTODOImplementedTODO
crates.sage_ir.symbols (8)8 Implemented4 Implemented7 TODO
associated_identityImplementedImplemented
associated_interfacesImplementedTODO
body_interfacesImplementedImplementedTODO
definition_identityImplementedTODO
external_fact_queriesImplementedTODO
external_identityImplementedTODO
kind_wrappersImplementedImplementedTODO
local_identityImplementedImplementedTODO
crates.sage_ir.types (27)16 Implemented12 TODO13 Implemented27 TODO
crates.sage_ir.types.aliases (2)1 Implemented1 TODO1 Implemented2 TODO
identityImplementedImplementedTODO
revelationTODOTODO
crates.sage_ir.types.binder (1)1 Implemented1 TODO1 Implemented1 TODO
owner_parametersImplementedTODOImplementedTODO
crates.sage_ir.types.body (13)4 Implemented9 TODO3 Implemented13 TODO
awaitTODOTODO
closuresTODOTODO
conditional_patternsTODOTODO
coroutinesTODOTODO
diagnosed_recoveryImplementedImplementedTODO
elaboratedTODOImplementedTODO
for_iterationTODOTODO
indexingTODOTODO
macro_expansionTODOTODO
no_inferenceImplementedImplementedTODO
resolved_referencesImplementedTODO
try_residualTODOTODO
typed_provenanceImplementedTODO
crates.sage_ir.types.calls (2)1 Implemented1 TODO1 Implemented2 TODO
dispatch_familiesTODOTODO
selected_semanticsImplementedImplementedTODO
crates.sage_ir.types.lifetimes (2)2 Implemented2 Implemented2 TODO
dummyImplementedImplementedTODO
unchecked_borrowsImplementedImplementedTODO
crates.sage_ir.types.operators (2)2 Implemented1 Implemented2 TODO
lazy_control_flowImplementedTODO
trait_callsImplementedImplementedTODO
scoped_identitiesImplementedTODO
crates.sage_ir.types.spans (4)4 Implemented4 Implemented4 TODO
generated_identityImplementedImplementedTODO
item_originImplementedImplementedTODO
offset_reuseImplementedImplementedTODO
relative_compositionImplementedImplementedTODO
crates.sage_oracle_harness (4)4 Implemented2 TODO1 Implemented4 TODO
crates.sage_oracle_harness.crate (4)4 Implemented2 TODO1 Implemented4 TODO
deterministic_emissionImplementedTODO
exact_comparisonImplementedTODOImplementedTODO
fixed_projectionImplementedTODO
independent_coverageImplementedTODOTODO
crates.sage_stash (5)5 Implemented5 Implemented
crates.sage_stash.storage (5)5 Implemented5 Implemented
handle_ownershipImplementedImplemented
immutable_entriesImplementedImplemented
query_valueImplementedImplemented
rooted_equalityImplementedImplemented
typed_interningImplementedImplemented
crates.sage_test_harness (25)25 Implemented25 Implemented
crates.sage_test_harness.compile_tests (25)25 Implemented25 Implemented
annotation_validationImplementedImplemented
blessing_gateImplementedImplemented
callsite_updatesImplementedImplemented
checking_scopeImplementedImplemented
compiler_conditionsImplementedImplemented
completed_typesImplementedImplemented
coordinatesImplementedImplemented
dependenciesImplementedImplemented
diagnostic_countsImplementedImplemented
diagnostic_locationsImplementedImplemented
editionImplementedImplemented
fixturesImplementedImplemented
grouped_observationsImplementedImplemented
invocationImplementedImplemented
production_executionImplementedImplemented
project_isolationImplementedImplemented
query_captureImplementedImplemented
query_projectionImplementedImplemented
renderingImplementedImplemented
resolved_symbolsImplementedImplemented
review_visibilityImplementedImplemented
rustc_executionImplementedImplemented
rustc_lintsImplementedImplemented
starting_expressionsImplementedImplemented
target_lineImplementedImplemented