ASELSANMicrokernel
S413 · SOURCE-BOUND GATE EVIDENCE

S413 · Exclusion-gated S243 join

tam S413 implementation modülü → Operations --test hedefi ile bağlı tam focused test → ayrı Operations kaydı Bu sayfa yalnız S413 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S413Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s413-exclusion-gated-s243-join-partial

uygulama/model · focused test · Operations · 3 exact excerpt

sequence-bound=true · implementation-bound=true
01 · Yürütme / doğrulama kodu

Kapının gerçek repository sözleşmesi

tam dosyaL1–L281
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join.rs::S413 exclusion gated s243 join implementation
#![allow(unexpected_cfgs)]

//! S413 real exclusion-gated S243 join.
//!
//! S413 is the first successor that consumes the exact S411 admission while
//! its S247 token is still live. It then joins the returned S242 authorities
//! with the post-EOI S240 receipt and publishes the resulting non-Copy S187
//! handoff into S243's bounded CPU1 slot. Idle/backpressure restores the exact
//! admission; a downstream consumer error is terminal after linear inputs
//! have been consumed. The sealed historical S244 placeholder is untouched.

use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s179_execution_caller_notification_sgi_delivery::{
    G8lS240SgiDelivery, G8lS240SgiDeliveryReceipt,
};
use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s179_execution_caller_notification_sgi_sender_runtime_callsite_request::G8lS242SenderRuntimeCallsiteState;
use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s242_authority_return_s240_receipt_deferred_consumer::{
    service_s243_deferred_authority_receipt_join, G8lS243DeferredConsumerError,
    G8lS243DeferredConsumerOutcome, G8lS243DeferredS187HandoffSlot,
};
use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::{
    G8lS411EphemeralExclusionAdmission, G8lS411EphemeralExclusionAdmissionError,
    G8lS411EphemeralExclusionAdmissionState, S411_DIRECT_SCHEDULER_ACCESS_SITES,
    S411_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES, S411_SOURCE_AUDIT_UNITS,
    S411_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES, S411_UNROUTED_DIRECT_ACCESS_SITES,
};
use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s412_exclusion_gated_join_preflight::{
    preflight_s412_exclusion_gated_join, G8lS412ExclusionGatedJoinPreflightError,
    G8lS412ExclusionGatedJoinPreflightOutcome, G8lS412ExclusionGatedJoinPreflightReceipt,
};

pub const S413_SOURCE_AUDIT_UNITS: usize = S411_SOURCE_AUDIT_UNITS;
pub const S413_DIRECT_SCHEDULER_ACCESS_SITES: usize = S411_DIRECT_SCHEDULER_ACCESS_SITES;
pub const S413_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES: usize =
    S411_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES;
pub const S413_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES: usize =
    S411_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES;
pub const S413_UNROUTED_DIRECT_ACCESS_SITES: usize = S411_UNROUTED_DIRECT_ACCESS_SITES;
pub const S413_PRODUCTION_S243_JOIN_CALLSITES: usize = 1;
pub const S413_OLD_S244_PLACEHOLDER_PUBLISH_SITES: usize = 0;
pub const S413_EXCLUSION_GATED_S243_JOIN_COMPLETE: bool = true;
pub const S413_S187_HANDOFF_PUBLICATION_REACHED: bool = true;
pub const S413_CPU1_HANDOFF_CONSUMPTION_COMPLETE: bool = false;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lS413ExclusionGatedJoinReceipt {
    attempt_id: u64,
    provider_request_id: u64,
    exclusive_token: u64,
}

impl G8lS413ExclusionGatedJoinReceipt {
    fn from_preflight(preflight: G8lS412ExclusionGatedJoinPreflightReceipt) -> Self {
        Self {
            attempt_id: preflight.attempt_id(),
            provider_request_id: preflight.provider_request_id(),
            exclusive_token: preflight.exclusive_token(),
        }
    }
    pub const fn attempt_id(&self) -> u64 {
        self.attempt_id
    }
    pub const fn provider_request_id(&self) -> u64 {
        self.provider_request_id
    }
    pub const fn exclusive_token(&self) -> u64 {
        self.exclusive_token
    }
    pub const fn s187_handoff_published(&self) -> bool {
        true
    }
    pub const fn is_authority(&self) -> bool {
        false
    }
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS413ExclusionGatedJoinOutcome {
    AwaitingAdmission,
    AwaitingInputs {
        authorities_ready: bool,
        delivery_receipt_ready: bool,
    },
    Backpressured,
    Published(G8lS413ExclusionGatedJoinReceipt),
}

#[derive(Debug)]
pub enum G8lS413ExclusionGatedJoinError<E, H> {
    S412(G8lS412ExclusionGatedJoinPreflightError),
    S411(G8lS411EphemeralExclusionAdmissionError),
    S243(G8lS243DeferredConsumerError<E, H>),
    AdmissionDisappeared,
    AdmissionBindingDrift,
    RestoreFailed(G8lS411EphemeralExclusionAdmissionError),
}

fn admission_matches_preflight(
    admission: &G8lS411EphemeralExclusionAdmission,
    preflight: G8lS412ExclusionGatedJoinPreflightReceipt,
    active_exclusive_token: Option<u64>,
) -> bool {
    admission.attempt_id() == preflight.attempt_id()
        && admission.provider_request_id() == preflight.provider_request_id()
        && admission.exclusive_token() == preflight.exclusive_token()
        && admission.validate_live_token(active_exclusive_token)
}

pub fn service_s413_model_exclusion_gated_s243_join<R, O, P, H, E, Consume>(
    admissions: &mut G8lS411EphemeralExclusionAdmissionState,
    s242: &mut G8lS242SenderRuntimeCallsiteState<R, O, P>,
    s240: &mut G8lS240SgiDelivery,
    output: &mut G8lS243DeferredS187HandoffSlot<H>,
    caller_cpu: usize,
    active_exclusive_token: Option<u64>,
    consume: Consume,
) -> Result<G8lS413ExclusionGatedJoinOutcome, G8lS413ExclusionGatedJoinError<E, H>>
where
    Consume:
        FnOnce(R, O, G8lS240SgiDeliveryReceipt, G8lS411EphemeralExclusionAdmission) -> Result<H, E>,
{
    let admission_view = admissions
        .pending_view(caller_cpu)
        .map_err(G8lS413ExclusionGatedJoinError::S411)?;
    let preflight = preflight_s412_exclusion_gated_join(
        admission_view,
        caller_cpu,
        active_exclusive_token,
        s242.returned_pending(),
        s240.receipt_pending(),
        !output.pending(),
    )
    .map_err(G8lS413ExclusionGatedJoinError::S412)?;
    let preflight = match preflight {
        G8lS412ExclusionGatedJoinPreflightOutcome::AwaitingAdmission => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingAdmission)
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::AwaitingInputs {
            authorities_ready,
            delivery_receipt_ready,
        } => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingInputs {
                authorities_ready,
                delivery_receipt_ready,
            })
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::Backpressured => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::Backpressured)
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::Ready(receipt) => receipt,
    };
    let admission = admissions
        .take(caller_cpu)
        .map_err(G8lS413ExclusionGatedJoinError::S411)?
        .ok_or(G8lS413ExclusionGatedJoinError::AdmissionDisappeared)?;
    if !admission_matches_preflight(&admission, preflight, active_exclusive_token) {
        admissions
            .restore(caller_cpu, admission)
            .map_err(G8lS413ExclusionGatedJoinError::RestoreFailed)?;
        return Err(G8lS413ExclusionGatedJoinError::AdmissionBindingDrift);
    }
    let mut reserved_admission = Some(admission);
    let result = service_s243_deferred_authority_receipt_join(
        s242,
        s240,
        output,
        caller_cpu,
        |runtime, owner, receipt| {
            let admission = reserved_admission
                .take()
                .expect("S413 admission must be consumed exactly once");
            consume(runtime, owner, receipt, admission)
        },
    );
    match result {
        Ok(G8lS243DeferredConsumerOutcome::Published) => {
            Ok(G8lS413ExclusionGatedJoinOutcome::Published(
                G8lS413ExclusionGatedJoinReceipt::from_preflight(preflight),
            ))
        }
        Ok(G8lS243DeferredConsumerOutcome::Idle) => {
            let admission = reserved_admission
                .take()
                .ok_or(G8lS413ExclusionGatedJoinError::AdmissionBindingDrift)?;
            admissions
                .restore(caller_cpu, admission)
                .map_err(G8lS413ExclusionGatedJoinError::RestoreFailed)?;
            Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingInputs {
                authorities_ready: s242.returned_pending(),
                delivery_receipt_ready: s240.receipt_pending(),
            })
        }
        Ok(G8lS243DeferredConsumerOutcome::Backpressured) => {
            let admission = reserved_admission
                .take()
                .ok_or(G8lS413ExclusionGatedJoinError::AdmissionBindingDrift)?;
            admissions
                .restore(caller_cpu, admission)
                .map_err(G8lS413ExclusionGatedJoinError::RestoreFailed)?;
            Ok(G8lS413ExclusionGatedJoinOutcome::Backpressured)
        }
        Err(error) => {
            if let Some(admission) = reserved_admission.take() {
                admissions
                    .restore(caller_cpu, admission)
                    .map_err(G8lS413ExclusionGatedJoinError::RestoreFailed)?;
            }
            Err(G8lS413ExclusionGatedJoinError::S243(error))
        }
    }
}

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
#[derive(Debug)]
pub enum G8lS413ProductionExclusionGatedJoinError {
    S412(G8lS412ExclusionGatedJoinPreflightError),
    S411(G8lS411EphemeralExclusionAdmissionError),
    S243(crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s242_authority_return_s240_receipt_deferred_consumer::G8lS243ProductionDeferredConsumerError),
    AdmissionDisappeared,
    AdmissionBindingDrift,
    RestoreFailed(G8lS411EphemeralExclusionAdmissionError),
}

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
pub unsafe fn service_s413_exclusion_gated_s243_join_on_cpu0(
) -> Result<G8lS413ExclusionGatedJoinOutcome, G8lS413ProductionExclusionGatedJoinError> {
    let preflight = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s412_exclusion_gated_join_preflight::service_s412_exclusion_gated_join_preflight_on_cpu0()
        .map_err(G8lS413ProductionExclusionGatedJoinError::S412)?;
    let preflight = match preflight {
        G8lS412ExclusionGatedJoinPreflightOutcome::AwaitingAdmission => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingAdmission)
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::AwaitingInputs {
            authorities_ready,
            delivery_receipt_ready,
        } => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingInputs {
                authorities_ready,
                delivery_receipt_ready,
            })
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::Backpressured => {
            return Ok(G8lS413ExclusionGatedJoinOutcome::Backpressured)
        }
        G8lS412ExclusionGatedJoinPreflightOutcome::Ready(receipt) => receipt,
    };
    let admission = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::take_s411_ephemeral_exclusion_admission_on_cpu0()
        .map_err(G8lS413ProductionExclusionGatedJoinError::S411)?
        .ok_or(G8lS413ProductionExclusionGatedJoinError::AdmissionDisappeared)?;
    let active_token = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s246_whole_scheduler_read_access_guard::S247_PRODUCTION_WHOLE_SCHEDULER_ACCESS_GATE.active_exclusive_token();
    if !admission_matches_preflight(&admission, preflight, active_token)
        || !admission.validate_live_token(active_token)
    {
        crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::restore_s411_ephemeral_exclusion_admission_on_cpu0(admission)
            .map_err(G8lS413ProductionExclusionGatedJoinError::RestoreFailed)?;
        return Err(G8lS413ProductionExclusionGatedJoinError::AdmissionBindingDrift);
    }
    let result = unsafe {
        crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s242_authority_return_s240_receipt_deferred_consumer::service_s243_deferred_authority_receipt_join_on_cpu0()
    }.map_err(G8lS413ProductionExclusionGatedJoinError::S243)?;
    match result {
        G8lS243DeferredConsumerOutcome::Published => {
            Ok(G8lS413ExclusionGatedJoinOutcome::Published(
                G8lS413ExclusionGatedJoinReceipt::from_preflight(preflight),
            ))
        }
        G8lS243DeferredConsumerOutcome::Idle => {
            crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::restore_s411_ephemeral_exclusion_admission_on_cpu0(admission)
                .map_err(G8lS413ProductionExclusionGatedJoinError::RestoreFailed)?;
            Ok(G8lS413ExclusionGatedJoinOutcome::AwaitingInputs {
                authorities_ready: false,
                delivery_receipt_ready: false,
            })
        }
        G8lS243DeferredConsumerOutcome::Backpressured => {
            crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::restore_s411_ephemeral_exclusion_admission_on_cpu0(admission)
                .map_err(G8lS413ProductionExclusionGatedJoinError::RestoreFailed)?;
            Ok(G8lS413ExclusionGatedJoinOutcome::Backpressured)
        }
    }
}
snippet sha256: 89f3d1501a60file sha256: 89f3d1501a60
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam dosyaL1–L285
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join.rs::S413 exclusion gated s243 join focused tests
#![recursion_limit = "256"]

use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s179_execution_caller_notification_sgi_delivery::{
    G8lS240SgiDelivery, S240_EXPECTED_COMMAND, S240_EXPECTED_ENABLE,
    S240_EXPECTED_RAW_ACK, S240_SOURCE_CPU1, S240_TARGET_CPU0, S240_TARGET_LIST_CPU0,
};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s179_execution_caller_notification_sgi_sender_runtime_callsite_request::{
    service_s242_sender_runtime_callsite_request, G8lS242SenderRuntimeCallsiteRequest,
    G8lS242SenderRuntimeCallsiteState,
};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s242_authority_return_s240_receipt_deferred_consumer::G8lS243DeferredS187HandoffSlot;
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s244_whole_scheduler_exclusion_admission_request::{
    service_s245_exclusion_admission_request, G8lS245WholeSchedulerExclusionAdmissionRequestState,
};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s246_whole_scheduler_read_access_guard::G8lS247WholeSchedulerAccessGate;
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s402_provider_invocation_observation_publication::{service_s402_model_provider_invocation_observation_publication, G8lS402ProviderInvocationObservationState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s404_scoped_authority_request_publication::{service_s404_model_scoped_authority_request_publication, G8lS404ScopedAuthorityRequestState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s407_live_exclusion_offer_publication::{try_publish_s407_model_live_exclusion_offer, G8lS407LiveExclusionOfferState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s408_live_offer_sgi_sender::{service_s408_model_live_offer_sgi_send, G8lS408LiveOfferSgiSenderState, S408_EXPECTED_ENABLE, S408_EXPECTED_RAW_ACK};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s409_live_offer_sgi_delivery::{service_s409_model_live_offer_sgi_delivery, G8lS409LiveOfferSgiDeliveryState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s410_exclusion_admission_candidate_publication::{service_s410_model_exclusion_admission_candidate_publication, G8lS410ExclusionAdmissionCandidateState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s411_ephemeral_exclusion_admission_constructor::{service_s411_model_ephemeral_exclusion_admission_constructor, G8lS411EphemeralExclusionAdmissionState};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join::*;

type TestS242 = G8lS242SenderRuntimeCallsiteState<u64, u64, u64>;

fn admission() -> (
    G8lS247WholeSchedulerAccessGate,
    G8lS411EphemeralExclusionAdmissionState,
) {
    let gate = G8lS247WholeSchedulerAccessGate::new();
    let mut providers = G8lS245WholeSchedulerExclusionAdmissionRequestState::new();
    service_s245_exclusion_admission_request(&mut providers, 0, true, true).unwrap();
    let mut observations = G8lS402ProviderInvocationObservationState::new();
    service_s402_model_provider_invocation_observation_publication(
        &mut observations,
        &gate,
        &mut providers,
        1,
    )
    .unwrap();
    let mut scoped = G8lS404ScopedAuthorityRequestState::new();
    service_s404_model_scoped_authority_request_publication(&mut scoped, &mut observations, 0)
        .unwrap();
    service_s245_exclusion_admission_request(&mut providers, 0, true, true).unwrap();
    let mut offers = G8lS407LiveExclusionOfferState::new();
    let offered = try_publish_s407_model_live_exclusion_offer(
        &mut offers,
        &gate,
        &mut providers,
        &mut scoped,
        1,
    )
    .unwrap()
    .unwrap();
    let offer = offered.offer();
    let mut sender = G8lS408LiveOfferSgiSenderState::new();
    sender
        .prepare_receiver(0, 1, S408_EXPECTED_ENABLE, 1, 0)
        .unwrap();
    let send = service_s408_model_live_offer_sgi_send(&mut sender, 1, &offered).unwrap();
    let mut delivery = G8lS409LiveOfferSgiDeliveryState::new();
    service_s409_model_live_offer_sgi_delivery(
        &mut delivery,
        0,
        S408_EXPECTED_RAW_ACK,
        send,
        offer,
        gate.active_exclusive_token(),
        |_| Ok::<(), ()>(()),
    )
    .unwrap();
    let mut candidates = G8lS410ExclusionAdmissionCandidateState::new();
    service_s410_model_exclusion_admission_candidate_publication(
        &mut candidates,
        &mut delivery,
        0,
        gate.active_exclusive_token(),
    )
    .unwrap();
    let mut admissions = G8lS411EphemeralExclusionAdmissionState::new();
    service_s411_model_ephemeral_exclusion_admission_constructor(
        &mut admissions,
        &mut candidates,
        0,
        gate.active_exclusive_token(),
    )
    .unwrap();
    core::mem::forget(offered);
    (gate, admissions)
}

fn returned_authorities() -> TestS242 {
    let mut state = TestS242::new();
    state
        .publish(G8lS242SenderRuntimeCallsiteRequest::new(11, 13, 17))
        .unwrap();
    service_s242_sender_runtime_callsite_request(&mut state, 1, |runtime, permit| {
        assert_eq!((*runtime, permit), (11, 17));
        Ok::<u32, ()>(S240_EXPECTED_COMMAND)
    })
    .unwrap();
    state
}

fn delivered_receipt() -> G8lS240SgiDelivery {
    let mut delivery = G8lS240SgiDelivery::new();
    delivery
        .prepare_receiver(
            S240_TARGET_CPU0,
            S240_SOURCE_CPU1,
            S240_EXPECTED_ENABLE,
            S240_TARGET_LIST_CPU0,
            0,
        )
        .unwrap();
    delivery
        .begin_send(S240_SOURCE_CPU1, S240_EXPECTED_COMMAND)
        .unwrap();
    let ack = delivery
        .accept_irq(S240_TARGET_CPU0, S240_EXPECTED_RAW_ACK)
        .unwrap();
    delivery.complete_eoi(ack, S240_EXPECTED_RAW_ACK).unwrap();
    delivery
}

#[test]
fn constants_promote_exactly_one_real_s243_join() {
    assert_eq!(S413_PRODUCTION_S243_JOIN_CALLSITES, 1);
    assert_eq!(S413_OLD_S244_PLACEHOLDER_PUBLISH_SITES, 0);
    assert!(S413_EXCLUSION_GATED_S243_JOIN_COMPLETE);
    assert!(S413_S187_HANDOFF_PUBLICATION_REACHED);
    assert!(!S413_CPU1_HANDOFF_CONSUMPTION_COMPLETE);
}

#[test]
fn exact_live_admission_consumes_both_inputs_and_publishes_handoff() {
    let (gate, mut admissions) = admission();
    let mut s242 = returned_authorities();
    let mut s240 = delivered_receipt();
    let mut output = G8lS243DeferredS187HandoffSlot::new();
    let outcome = service_s413_model_exclusion_gated_s243_join(
        &mut admissions,
        &mut s242,
        &mut s240,
        &mut output,
        0,
        gate.active_exclusive_token(),
        |runtime, owner, receipt, admission| {
            assert_eq!((runtime, owner), (11, 13));
            assert_eq!(receipt.raw_ack(), S240_EXPECTED_RAW_ACK);
            assert!(admission.validate_live_token(gate.active_exclusive_token()));
            Ok::<u64, ()>(23)
        },
    )
    .unwrap();
    let G8lS413ExclusionGatedJoinOutcome::Published(receipt) = outcome else {
        panic!("join must publish")
    };
    assert_eq!(
        (
            receipt.attempt_id(),
            receipt.provider_request_id(),
            receipt.exclusive_token()
        ),
        (1, 2, 2)
    );
    assert!(receipt.s187_handoff_published());
    assert!(!admissions.pending());
    assert!(!s242.returned_pending());
    assert!(!s240.receipt_pending());
    assert_eq!(output.take(1).unwrap(), Some(23));
}

#[test]
fn missing_inputs_restore_exact_admission() {
    let (gate, mut admissions) = admission();
    let before = admissions.pending_view(0).unwrap().unwrap();
    let mut s242 = TestS242::new();
    let mut s240 = G8lS240SgiDelivery::new();
    let mut output = G8lS243DeferredS187HandoffSlot::<u64>::new();
    let result = service_s413_model_exclusion_gated_s243_join(
        &mut admissions,
        &mut s242,
        &mut s240,
        &mut output,
        0,
        gate.active_exclusive_token(),
        |_, _, _, _| Ok::<u64, ()>(1),
    )
    .unwrap();
    assert!(matches!(
        result,
        G8lS413ExclusionGatedJoinOutcome::AwaitingInputs { .. }
    ));
    assert_eq!(admissions.pending_view(0).unwrap(), Some(before));
}

#[test]
fn stale_token_preserves_all_linear_inputs() {
    let (_gate, mut admissions) = admission();
    let mut s242 = returned_authorities();
    let mut s240 = delivered_receipt();
    let mut output = G8lS243DeferredS187HandoffSlot::<u64>::new();
    assert!(matches!(
        service_s413_model_exclusion_gated_s243_join(
            &mut admissions,
            &mut s242,
            &mut s240,
            &mut output,
            0,
            Some(999),
            |_, _, _, _| Ok::<u64, ()>(1)
        ),
        Err(G8lS413ExclusionGatedJoinError::S412(_))
    ));
    assert!(admissions.pending() && s242.returned_pending() && s240.receipt_pending());
}

#[test]
fn occupied_output_backpressures_without_consumption() {
    let (gate, mut admissions) = admission();
    let mut s242 = returned_authorities();
    let mut s240 = delivered_receipt();
    let mut output = G8lS243DeferredS187HandoffSlot::new();
    output.publish(41u64).unwrap();
    let outcome = service_s413_model_exclusion_gated_s243_join(
        &mut admissions,
        &mut s242,
        &mut s240,
        &mut output,
        0,
        gate.active_exclusive_token(),
        |_, _, _, _| Ok::<u64, ()>(1),
    )
    .unwrap();
    assert!(matches!(
        outcome,
        G8lS413ExclusionGatedJoinOutcome::Backpressured
    ));
    assert!(admissions.pending() && s242.returned_pending() && s240.receipt_pending());
}

#[test]
fn production_orders_preflight_take_live_revalidate_then_s243() {
    let source = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join.rs");
    let start = source
        .find("service_s413_exclusion_gated_s243_join_on_cpu0")
        .unwrap();
    let body = &source[start..];
    let preflight = body
        .find("service_s412_exclusion_gated_join_preflight_on_cpu0")
        .unwrap();
    let take = body
        .find("take_s411_ephemeral_exclusion_admission_on_cpu0")
        .unwrap();
    let validate = body.find("validate_live_token").unwrap();
    let join = body
        .find("service_s243_deferred_authority_receipt_join_on_cpu0")
        .unwrap();
    assert!(preflight < take && take < validate && validate < join);
}

#[test]
fn s413_is_registered_and_irq_chain_invokes_it_after_s411() {
    let name = "g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join";
    assert!(include_str!("../../kernel/src/main.rs").contains(&format!("mod {name};")));
    assert!(include_str!("../src/lib.rs").contains(&format!("pub mod {name};")));
    let irq = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s409_live_offer_sgi_delivery.rs");
    let s411 = irq
        .find("service_s411_ephemeral_exclusion_admission_constructor_on_cpu0")
        .unwrap();
    let s413 = irq
        .find("service_s413_exclusion_gated_s243_join_on_cpu0")
        .unwrap();
    assert!(s411 < s413);
}

#[test]
fn s413_does_not_forge_the_historical_s244_placeholder() {
    let source = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join.rs");
    assert!(!source.contains("G8lS244ProductionWholeSchedulerExclusionAdmission"));
    assert!(!source.contains("service_s244_whole_scheduler_exclusion_admission_on_cpu0"));
}
snippet sha256: 832ce79aaaeafile sha256: 832ce79aaaea
03 · Kapı kimlik kaydı

Operations sıra, kimlik ve başlık bağı

tam Operations kaydıL304–L320
website/src/lib/operations.ts::g8l-s413-exclusion-gated-s243-join-partial
  {
    id: "g8l-s413-exclusion-gated-s243-join-partial",
    sequence: 413,
    slug: "exclusion_gated_s243_join",
    title: "Exclusion-gated S243 join",
    focusedTests: 8,
    sourceBytes: 13455,
    sourceSha256:
      "89f3d1501a60b6a3b202f130ac4c7c5f9831ad1008986e79c1d557ca01aafe6d",
    testBytes: 12470,
    testSha256:
      "832ce79aaaeaf4bf9855e3e076f624c54df5d1e3e55e49f7ac595e228bc66f24",
    acceptance:
      "Exact S411 ephemeral admission altında mevcut S243 deferred authority/receipt join'i çağrılır ve S187 handoff publication'a kadar kaynak yolu ulaşır.",
    retainedBoundary:
      "Eski S244 placeholder publisher kullanılmaz; CPU1 handoff consumption sonraki kapılara bırakılır.",
  },
snippet sha256: 222c3bf7b3a0file sha256: 9726dbf00f84
Focused test komutu
CARGO_INCREMENTAL=0 cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s413_exclusion_gated_s243_join -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S413-Exclusion-Gated-S243-Join-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 3050638b71a684d8f8f947a8a6faa237a17fa8db5dc0db04fb207b668b462af9