ASELSANMicrokernel
S416 · SOURCE-BOUND GATE EVIDENCE

S416 · Production exclusion handshake invocation

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

S416Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s416-production-exclusion-handshake-invocation-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–L125
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation.rs::S416 production exclusion handshake invocation implementation
#![allow(unexpected_cfgs)]

//! S416 bounded production invocation of the S407-S415 exclusion handshake.
//!
//! CPU1 now has one real timer-chain callsite that constructs the scoped
//! provider authority, publishes its live offer, sends dedicated SGI3, polls
//! the one-shot S414 ACK for a fixed bound, and releases through S415. A
//! timeout explicitly clears the offer and releases the lease; no unbounded
//! loop or cross-tick authority retention is introduced. This is source-level
//! production reachability, not a supported-profile runtime observation.

use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::{
    S415_DIRECT_SCHEDULER_ACCESS_SITES, S415_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES,
    S415_SOURCE_AUDIT_UNITS, S415_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES,
    S415_UNROUTED_DIRECT_ACCESS_SITES,
};

pub const S416_SOURCE_AUDIT_UNITS: usize = S415_SOURCE_AUDIT_UNITS;
pub const S416_DIRECT_SCHEDULER_ACCESS_SITES: usize = S415_DIRECT_SCHEDULER_ACCESS_SITES;
pub const S416_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES: usize =
    S415_SOURCE_MODEL_COVERED_DIRECT_ACCESS_SITES;
pub const S416_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES: usize =
    S415_PRODUCTION_GUARDED_DIRECT_ACCESS_SITES;
pub const S416_UNROUTED_DIRECT_ACCESS_SITES: usize = S415_UNROUTED_DIRECT_ACCESS_SITES;
pub const S416_ACK_POLL_LIMIT: usize = 4096;
pub const S416_PRODUCTION_HANDSHAKE_CALLSITES: usize = 1;
pub const S416_PRODUCTION_HANDSHAKE_CALLSITE_COMPLETE: bool = true;
pub const S416_END_TO_END_EXCLUSION_SOURCE_PATH_COMPLETE: bool = true;
pub const S416_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS: usize = 0;
pub const S416_CPU1_S187_HANDOFF_CONSUMPTION_COMPLETE: bool = false;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS416BoundedAckPollOutcome {
    InvalidLimit,
    AckObserved { polls: usize },
    TimedOut { polls: usize },
}

pub fn run_s416_bounded_ack_poll<Poll>(limit: usize, mut poll: Poll) -> G8lS416BoundedAckPollOutcome
where
    Poll: FnMut() -> bool,
{
    if limit == 0 {
        return G8lS416BoundedAckPollOutcome::InvalidLimit;
    }
    for polls in 1..=limit {
        if poll() {
            return G8lS416BoundedAckPollOutcome::AckObserved { polls };
        }
        core::hint::spin_loop();
    }
    G8lS416BoundedAckPollOutcome::TimedOut { polls: limit }
}

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS416ProductionExclusionHandshakeOutcome {
    Idle,
    Completed {
        receipt: crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::G8lS415JoinAckAuthorityReleaseReceipt,
        polls: usize,
    },
    TimedOutReleased {
        attempt_id: u64,
        provider_request_id: u64,
        exclusive_token: u64,
        polls: usize,
    },
}

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
#[derive(Debug)]
pub enum G8lS416ProductionExclusionHandshakeError {
    S407(crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s407_live_exclusion_offer_publication::G8lS407LiveExclusionOfferError),
    S408(crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s408_live_offer_sgi_sender::G8lS408ProductionSgiError),
    S415(crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::G8lS415JoinAckAuthorityReleaseError),
    AuthorityDisappeared,
    TimeoutRelease(crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s407_live_exclusion_offer_publication::G8lS407LiveExclusionOfferError),
}

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
pub fn service_s416_production_exclusion_handshake_on_cpu1(
) -> Result<G8lS416ProductionExclusionHandshakeOutcome, G8lS416ProductionExclusionHandshakeError> {
    let offered = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s407_live_exclusion_offer_publication::try_publish_s407_production_live_exclusion_offer_on_cpu1()
        .map_err(G8lS416ProductionExclusionHandshakeError::S407)?;
    let Some(offered) = offered else {
        return Ok(G8lS416ProductionExclusionHandshakeOutcome::Idle);
    };
    let mut authority = Some(offered);
    crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s408_live_offer_sgi_sender::send_s408_live_offer_sgi_from_cpu1(
        authority.as_ref().ok_or(G8lS416ProductionExclusionHandshakeError::AuthorityDisappeared)?,
    ).map_err(G8lS416ProductionExclusionHandshakeError::S408)?;

    for poll in 1..=S416_ACK_POLL_LIMIT {
        match crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::service_s415_production_join_ack_authority_release_on_cpu1(&mut authority)
            .map_err(G8lS416ProductionExclusionHandshakeError::S415)?
        {
            crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::G8lS415JoinAckAuthorityReleaseOutcome::AwaitingAck => {
                core::hint::spin_loop();
            }
            crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s415_join_ack_authority_release::G8lS415JoinAckAuthorityReleaseOutcome::Released(receipt) => {
                return Ok(G8lS416ProductionExclusionHandshakeOutcome::Completed {
                    receipt,
                    polls: poll,
                });
            }
        }
    }

    let offered = authority
        .take()
        .ok_or(G8lS416ProductionExclusionHandshakeError::AuthorityDisappeared)?;
    let released = offered
        .release()
        .map_err(G8lS416ProductionExclusionHandshakeError::TimeoutRelease)?;
    Ok(
        G8lS416ProductionExclusionHandshakeOutcome::TimedOutReleased {
            attempt_id: released.attempt_id(),
            provider_request_id: released.provider_request_id(),
            exclusive_token: released.exclusive_token(),
            polls: S416_ACK_POLL_LIMIT,
        },
    )
}
snippet sha256: 613138ee211afile sha256: 613138ee211a
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam dosyaL1–L107
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation.rs::S416 production exclusion handshake invocation focused tests
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation::*;

#[test]
fn constants_define_bounded_single_production_callsite() {
    assert_eq!(S416_ACK_POLL_LIMIT, 4096);
    assert_eq!(S416_PRODUCTION_HANDSHAKE_CALLSITES, 1);
    assert!(S416_PRODUCTION_HANDSHAKE_CALLSITE_COMPLETE);
    assert!(S416_END_TO_END_EXCLUSION_SOURCE_PATH_COMPLETE);
    assert_eq!(S416_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS, 0);
    assert!(!S416_CPU1_S187_HANDOFF_CONSUMPTION_COMPLETE);
}

#[test]
fn bounded_poll_stops_on_first_ack() {
    let mut calls = 0usize;
    let outcome = run_s416_bounded_ack_poll(8, || {
        calls += 1;
        calls == 3
    });
    assert_eq!(
        outcome,
        G8lS416BoundedAckPollOutcome::AckObserved { polls: 3 }
    );
    assert_eq!(calls, 3);
}

#[test]
fn bounded_poll_times_out_exactly_at_limit() {
    let mut calls = 0usize;
    let outcome = run_s416_bounded_ack_poll(5, || {
        calls += 1;
        false
    });
    assert_eq!(outcome, G8lS416BoundedAckPollOutcome::TimedOut { polls: 5 });
    assert_eq!(calls, 5);
}

#[test]
fn zero_limit_is_rejected_without_poll() {
    let mut called = false;
    let outcome = run_s416_bounded_ack_poll(0, || {
        called = true;
        true
    });
    assert_eq!(outcome, G8lS416BoundedAckPollOutcome::InvalidLimit);
    assert!(!called);
}

#[test]
fn production_orders_offer_send_bounded_ack_release() {
    let source = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation.rs");
    let start = source
        .find("service_s416_production_exclusion_handshake_on_cpu1")
        .unwrap();
    let body = &source[start..];
    let compact: String = body.split_whitespace().collect();
    let offer = compact
        .find("try_publish_s407_production_live_exclusion_offer_on_cpu1")
        .unwrap();
    let send = compact.find("send_s408_live_offer_sgi_from_cpu1").unwrap();
    let bounded = compact.find("forpollin1..=S416_ACK_POLL_LIMIT").unwrap();
    let ack = compact
        .find("service_s415_production_join_ack_authority_release_on_cpu1")
        .unwrap();
    let timeout_release = compact.rfind("offered.release()").unwrap();
    assert!(offer < send && send < bounded && bounded < ack && ack < timeout_release);
}

#[test]
fn timeout_is_an_explicit_release_not_an_authority_leak() {
    let source = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation.rs");
    let compact: String = source.split_whitespace().collect();
    assert!(compact.contains("TimedOutReleased"));
    assert!(compact.contains("authority.take()"));
    assert!(compact.contains("offered.release()"));
    assert!(!compact.contains("loop{"));
}

#[test]
fn cpu1_timer_chain_places_s416_after_preflight_before_observation_fallback() {
    let source = include_str!("../../kernel/src/arch/aarch64/exceptions.rs");
    let s405 = source
        .find("service_s405_scoped_authority_provider_preflight_on_cpu1")
        .unwrap();
    let s416 = source
        .find("service_s416_production_exclusion_handshake_on_cpu1")
        .unwrap();
    let s402 = source
        .find("service_s402_provider_invocation_observation_publication_on_cpu1")
        .unwrap();
    assert!(s405 < s416 && s416 < s402);
    assert_eq!(
        source
            .matches("service_s416_production_exclusion_handshake_on_cpu1")
            .count(),
        1
    );
}

#[test]
fn s416_is_registered_separately_and_supersedes_s415_dormancy() {
    let name = "g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation";
    assert!(include_str!("../../kernel/src/main.rs").contains(&format!("mod {name};")));
    assert!(include_str!("../src/lib.rs").contains(&format!("pub mod {name};")));
    assert!(include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s416_production_exclusion_handshake_invocation.rs").contains("service_s415_production_join_ack_authority_release_on_cpu1"));
}
snippet sha256: 7699ce6712c9file sha256: 7699ce6712c9
03 · Kapı kimlik kaydı

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

tam Operations kaydıL355–L371
website/src/lib/operations.ts::g8l-s416-production-exclusion-handshake-invocation-partial
  {
    id: "g8l-s416-production-exclusion-handshake-invocation-partial",
    sequence: 416,
    slug: "production_exclusion_handshake_invocation",
    title: "Production exclusion handshake invocation",
    focusedTests: 8,
    sourceBytes: 6340,
    sourceSha256:
      "613138ee211a4490d0b20faa57ea64ed0874854f2de6d1903d595ca8c33f109b",
    testBytes: 4320,
    testSha256:
      "7699ce6712c90b1f5c4c3bf890dbf87908cbec7feafd118d33b52d59ab317590",
    acceptance:
      "CPU1 production timer zinciri S401–S415 handshake'ini tek callsite'ta çağırır; ACK beklemesi 4096 poll ile bounded ve source path complete'tir.",
    retainedBoundary:
      "Supported-profile runtime observation sıfırdır ve S187 handoff henüz CPU1 continuation'a tüketilmez.",
  },
snippet sha256: 4a48dbab9aa8file 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_s416_production_exclusion_handshake_invocation -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S416-Production-Exclusion-Handshake-Invocation-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 3050638b71a684d8f8f947a8a6faa237a17fa8db5dc0db04fb207b668b462af9