ASELSANMicrokernel
S354 · SOURCE-BOUND GATE EVIDENCE

S354 · General-user-task spawn production writer guard integration

production acquire → S247 guard modülü → Operations-bound focused test Bu sayfa yalnız S354 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S354Production writer guardOperations id exactsource SHA exacttest target exact

operation: g8l-s354-general-user-spawn-writer-guard-integration-partial

production · S247 guard · focused test · Operations · 4 exact excerpt

sequence-bound=true · implementation-bound=true
01 · Test edilen uygulama/model kodu

Kapının yürüttüğü gerçek kaynak

tam Rust öğesiL4816–L4881
kernel/src/task/scheduler.rs::spawn_user_task_with_arg

/// User task spawn'a u64 argümanı desteği. Argüman `x0`'a yazılır →
/// EL0'a `eret` sonrası user fn'in ilk parametresi olur.
///
/// Kullanım: `extern "C" fn ipc_server_loop(ep: u64) -> !` gibi imzayla
/// fn yazarsanız, `ep` argümanı spawn anında verilir. Bu sayede user
/// task kernel `.bss`'inden statik okumak zorunda kalmaz (KERNEL_DATA
/// flag'i NoUser → EL0 okuyamaz).
pub unsafe fn spawn_user_task_with_arg(
    name: &str,
    user_entry: extern "C" fn(u64) -> !,
    arg0: u64,
    stack_size: usize,
    priority: u8,
    time_slice: u32,
) -> Result<JoinHandle, TaskSpawnError> {
    // ABI olarak `extern "C" fn(u64) -> !` ile `extern "C" fn() -> !` aynı
    // entry point'i çağırır; AArch64 calling convention'da x0 ilk arg, ve user
    // fn kullanmasa bile zarar yok. spawn fonksiyonu void imzayı bekliyor.
    let user_entry_void: extern "C" fn() -> ! = core::mem::transmute(user_entry);
    let s354_irq_guard = crate::arch::aarch64::IrqGuard::new();

    // S255 copies the only scheduler input into an owned scalar and releases
    // its reader before private construction begins. No mutable scheduler
    // alias exists while validation, ASID/root/stack allocation, mappings,
    // Task fields, context, or JoinHandle ownership are prepared.
    let initial_vruntime = Scheduler::min_vruntime().saturating_sub(20);
    let (task, handle) = Scheduler::build_unpublished_task(
        name,
        crate::task::user_first_kernel_entry,
        stack_size,
        priority,
        time_slice,
        true,
        Some(user_entry_void),
        arg0,
        initial_vruntime,
    )?;
    let task_id = task.id;

    // Exact S354 publication boundary: all fallible preparation is complete
    // before the CPU0-only lease and the only mutable scheduler alias.
    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    let s354_writer_access = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration::acquire_s354_production_scheduler_writer_access()
        .unwrap_or_else(|error| {
            panic!(
                "S354 general-user spawn writer guard failed closed: {:?}",
                error
            )
        });
    let sched = &mut *core::ptr::addr_of_mut!(SCHEDULER);
    sched.ready_queue.push(PriorityTask::new(Box::new(task)));
    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    drop(s354_writer_access);
    drop(s354_irq_guard);

    crate::kprintln!(
        "[Scheduler] Task #{} '{}' (prio={}, slice={}, user={}) spawn edildi",
        task_id,
        name,
        priority,
        time_slice,
        true
    );
    Ok(handle)
}
snippet sha256: 992f64b1e10efile sha256: 838dd474448c
02 · Ortak exclusion üyeliği

S247 production writer guard

tam Rust öğesiL164–L176
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration.rs::acquire_s354_production_scheduler_writer_access

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
pub fn acquire_s354_production_scheduler_writer_access(
) -> Result<G8lS354ProductionSchedulerWriterAccess, G8lS247WholeSchedulerAccessError> {
    let caller_cpu =
        crate::percpu::try_current_cpu_id().ok_or(G8lS247WholeSchedulerAccessError::InvalidCpu)?;
    if caller_cpu != crate::g8l_runtime_contract::CPU0 {
        return Err(G8lS247WholeSchedulerAccessError::InvalidCpu);
    }
    let access = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s246_whole_scheduler_read_access_guard::S247_PRODUCTION_WHOLE_SCHEDULER_ACCESS_GATE
        .try_acquire_exclusive_for_valid_cpu(caller_cpu)?;
    Ok(G8lS354ProductionSchedulerWriterAccess { _access: access })
}
snippet sha256: 25441c941850file sha256: c82678e546ff
03 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam Rust öğesiL388–L397
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration.rs::general_user_spawn_boundary_has_exactly_one_s354_acquire

#[test]
fn general_user_spawn_boundary_has_exactly_one_s354_acquire() {
    assert_eq!(
        general_user_spawn_boundary()
            .matches("acquire_s354_production_scheduler_writer_access")
            .count(),
        1
    );
}
snippet sha256: eab222d68669file sha256: 83d31495e33a
04 · Kapı kimlik kaydı

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

tam Operations kaydıL12723–L12819
website/src/lib/operations.ts::g8l-s354-general-user-spawn-writer-guard-integration-partial
  {
    id: "g8l-s354-general-user-spawn-writer-guard-integration-partial",
    date: "2026-08-28",
    sequence: 354,
    status: "passed",
    umbrella_status: "partial",
    title: "S354 · General-user-task spawn production writer guard integration",
    summary:
      "S354, spawn_user_task_with_arg içindeki exact tek ready-queue publication mutation'ını S353 ve 44 production reader'ın kullandığı aynı statik S247 state word'e bağlar. S255 min_vruntime owned scalar snapshot'ı, user-entry ve stack-overflow doğrulaması, task-id/ASID/root/kernel+user stack allocation, user mapping, complete Task/EL0 frame/context ve JoinHandle sahipliği writer alınmadan private builder içinde tamamlanır. Yalnız ardından gerçek CPU0 kimliğiyle exclusive S354 writer alınır, exact tek mutable SCHEDULER aliası kurulur ve ready_queue.push bir kez yapılır. Writer, ardından IRQ guard tarihsel spawn diagnostic'i ve Ok dönüşünden önce explicit bırakılır. Guarded writer 27/69, açık writer 42, provider authority 0 ve whole-scheduler exclusion false'dur. Beş direct with-arg ve iki transitive no-arg source entry path vardır; RPi5-only wrapper supported-profile runtime observation=0'dır. Kernel-task spawn sınırı S355 için ayrı açık kalır.",
    evidence: [
      "Focused S354 general-user spawn writer-integration kapısının ilk koşusu 41/42 oldu. Tek RED ürün kodunda değildi: private builder'ın writer'dan önce yaptığı mevcut USER_NORMAL mapping diagnostic'ini kaynak-sözleşme testi gereksiz biçimde yasaklıyordu. Scheduler publication ve mutable-alias yasakları korunarak yalnız bu fazla diagnostic iddiası kaldırıldı; taze koşu 42/42 PASS verdi.",
      "İlk seçili regresyonda S353 tarihsel testi S354'ün hâlâ açık kalmasını istediği için 39/40, task_publication_source ise x0 initialization ve publication'ı artık aynı Scheduler::spawn gövdesinde aradığı için 1/2 oldu. İki assertion daha güçlü güncel sözleşmeye taşındı: x0 private builder sonucu öncesinde kurulmalı; builder dönüşü S354 acquire→alias→push sırasından önce olmalı; S353→S354 ayrı transaction ve exact tek acquire korunmalı. Ürün/coverage beklentisi gevşetilmedi. Final seçili regresyon 8 grup / 150/150 PASS'tir: S354 42/42, S353 40/40, S352 39/39, S255 11/11, ELF loader 7/7, task lifecycle 5/5, task publication 2/2 ve task spawn ASID 4/4.",
      "Production kaynak sırası user-entry ABI dönüşümü → S354 IrqGuard → S255 min_vruntime owned scalar → scheduler referansı almayan build_unpublished_task → entry/stack validation → task-id/ASID/root/stack allocation → USER_NORMAL mapping → complete Task/x0/EL0 frame/context → JoinHandle ownership → CPU0-only S354 writer → exact tek mutable scheduler aliası → exact tek ready_queue.push → writer drop → IRQ drop → tarihsel spawn diagnostic → Ok olarak kaynak-kilitlidir.",
      "Scheduler::build_unpublished_task artık initial_vruntime owned u64 değerini alan associated builder'dır. MissingUserEntry ve StackSizeOverflow, task-id exhaustion, ASID allocation, root/stack allocation, guard canary ve user mapping ile complete Task kurulumu bu private değerde tamamlanır; builder SCHEDULER referansı, ready_queue.push veya container publication içermez.",
      "General user Task için Ready state, x0=initial_user_arg0, kernel ve user stack ownership, guard pointer, unique root+ASID, owns_page_table_root=true, empty CNode, address_space_quiesced=false, first-entry TaskContext, user SP/ELR/SPSR ve JoinHandle finished/task_id ownership writer acquisition'dan önce kuruludur.",
      "Writer scope'unda fallible `?;` veya `)?` yolu, early Err, allocation, mapping, Task construction, diagnostics ya da context switch yoktur. Exact bir S354 acquire, bir addr_of_mut!(SCHEDULER), bir ready_queue.push ve bir explicit writer drop vardır. Tarihsel ordinary Scheduler::spawn publication'ı S355 için distinct later boundary olarak korunur ve S354 lease'i oraya taşınmaz.",
      "Aynı S247 state word üzerinde CPU0-only membership, non-CPU0 callback-öncesi rejection, reader→writer, writer→reader ve writer→writer exclusion, callback-error sonrası exact release ve S353→S354 token monotonluğu doğrulandı.",
      "S354 preflight önce S353'ün 44 guarded reader / 26 guarded writer / 43 open envanterini exact doğrular; yalnız sonra 27/69 guarded writer ve 42 open sonucu üretir. Inventory drift fail-closed reddedilir. S245 request yalnız non-consuming pending view ile incelenir; take edilmez, S244 admission veya provider authority üretilmez.",
      "Kaynak envanteri main.rs içinde dört direct spawn_user_task_with_arg callsite ve scheduler.rs içindeki spawn_user_task wrapper'ında bir direct callsite, ayrıca main.rs içinde wrapper'a ulaşan iki no-arg entry path gösterir: 5 direct + 2 transitive = 7 source path. Production S354 wrapper exact AArch64 none + board-rpi5 cfg altındadır; source wiring supported-profile invocation, runtime telemetry veya fiziksel kabul değildir ve runtime observations=0'dır.",
      "Fresh izole AArch64 profilleri 4/4 exit 0 verdi. Build logları: board-qemu 111451 B / fb1349fa8d9f49e1461a6dedfcbf9300748de3778a2dfb63fde93ab625b28aa2 / 293 warning header; board-rpi4 150192 B / ac8f4a69478cf9260e9cfa3e9522ae133563674e5201e98c96c6b9f0199c915b / 391; board-rpi5 565951 B / 5f8fca08f73eef105c00238eaafea9c0a66d765a5608608732ea6346ceb11718 / 1272; board-rpi5+smp 565893 B / f68993c811c7ac5a5b3b337bbbe98e98e5b96abb6ef9ac0c151ee8d59d28e7fe / 1272. Zero-warning iddiası yoktur.",
      "Build log ölçüsü ELF ölçüsü gibi sunulmaz. Fresh ELF artifact'leri ayrıca board-qemu 12594880 B / 578d9c8edf036963c5a104211dd604840cb0870f7548d387753675b104804944; board-rpi4 7723072 B / 01db43cf7c1d62396b25f8905702c683f89953edb6a3096540eff22850654e45; board-rpi5 13219384 B / 297ec93098601be25314de3b3baeec3bc03bcd621975d8263d09198c068c4099 ve board-rpi5+smp 13221248 B / 14d829666b7c57b69ef1b94f4ce9e4600f4587db3578eb443e6ea03d16dc5cdf olarak ölçüldü.",
      "S238–S354 dependency matrisi S353'ün exact 117 hedeflik listesine yalnız S354 eklenerek iki bağımsız seri koşuda 118 grup / 2100/2100 PASS verdi. Ham özetler 27674 B ve 54ec8386a278f0ff966f1fd77cf6c9b18c9c449657e3a9c2ea260cde3c200308 / 232cc37ba536d41b30a27befcf5caf7e8b1a38490514c683af5fc69ee0a3e3a5; süre alanları nedeniyle 61 diff satırı vardır. 27792 B normalize özetler 1c6cab503e5688a9897cdd9fe820340bd91ac39fada71bae95a3a94593319d35 ile byte-eşittir.",
      "Exact yedi tarihsel frozen assertion dışındaki seri workspace 316 sonuç grubu / 3942 PASS / 0 fail / 7 filtered verdi; 69020 B log SHA-256 ad5f0bbfc07046cf481b40da168e5ba0cacf6716521e95455d184958c4eaa241'dir.",
      "Filtresiz workspace exit 101 ile yalnız frozen S96 wiring_does_not_mutate_timer_gic_boot_or_expand_runtime_scope source-identity reddinde durdu; 269 sonuç grubunda 3687 PASS / 1 fail, 64242 B log SHA-256 7f2de68d159d2802bd95e2af7b61d05953d05626f68d0e6f20236c40138a9a16'dır ve global workspace GREEN iddia edilmez.",
      "make verify-qemu 116355 B / 23aab7171f1c6b6a836affcf2111197b61b7644858dce4d4e4072d5877813346 ile strict ELF W^X 31/31, S130–S154 Runtime-OOM/deadline zinciri, IPC reply 20/20, scheduler SEC5 ve kernel fault/panic marker 0 PASS verdi. RPi5-only S354 writer bu board-qemu koşusunda runtime-observed değildir.",
      "S354 modülü, focused test, scheduler refactorı ve güçlendirilen iki tarihsel test ayrı rustfmt --check altında PASS'tir. Global cargo fmt 56491 B / 143170ce93c51842d576fed7c0d19ec4d573bbcb83f0440e8f626eccda50ca3c ile miras S345+ ve manifest farklarında RED'dir; global format GREEN iddia edilmez.",
      "S354 web/publication kabulü ayrı transaction'da tamamlandı. Website 563/563 test, lint, boş çıktılı TypeScript ve 23/23 static route build PASS verdi. Export 194 dosyadır; Timeline ve yol-haritasi S354 dahil 193 ayrı data-gate-policy kartı taşır. S354 promotion policy 9172 karakterdir ve 1573 karakterlik S324 yoğunluk tabanının üstündedir.",
      "İlk Cloudflare Pages production/main içerik yayını 936523ab-7d0c-469d-9c56-faabe90a097b kimliğiyle 110 upload + 84 existing = 194 dosya olarak tamamlandı. Cache-busted custom-domain doğrulamasında Operations HTTP 200 / 11126743 B / 89bef491af6b317502f1faa03683dded73493e8ef6bc5dd01c30a36019295dbc, Timeline HTTP 200 / 3245740 B / 3ad41f15b163637bc814e8453a8274bc81214f95723ccd6700bcd3ce26d2188f ve yol-haritasi HTTP 200 / 3245488 B / 9f221ae21f33496f4e29f61126ebdeabc41db943115ddfd86615e47e83ef8a8a ile ilgili yerel out dosyasına byte-exact PASS verdi. Immutable 936523ab deployment hostname probe'u 10 saniyede curl exit 28 / HTTP 000 verdi; custom-domain PASS bu erişim sınırını gizlemez.",
      "S354 için güç, SD kart, Mac kart erişimi, UART capture, raw validation, archive veya promotion işlemi yapılmadı: physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S354=NO.",
      "S354 bazlı bağlayıcı olmayan planlama görünümü R1 S354–S384, R2 S409–S459, R3 S538+, kaba S514–S564 ve risk paylı merkez ≈S539'dur. Bu projeksiyon yeni sıra veya ürün taahhüdü oluşturmaz.",
    ],
    commands: [
      "cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration -- --test-threads=1",
      "cargo build -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5",
      "cargo build -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5,smp",
      "make verify-qemu",
      "npm test && npm run lint && npx tsc --noEmit && npm run build && npm run deploy",
    ],
    terminalSessions: [
      {
        id: "g8l-s354-focused-general-user-spawn-writer-guard",
        title: "S354 focused general-user-task spawn writer membership",
        commandLines: [
          "cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration -- --test-threads=1",
        ],
        outputLines: [
          "initial test result: RED; S354 focused 41 passed; 1 failed; overstrict private diagnostic assertion",
          "final test result: ok; S354 focused 1 group / 42 passed; 0 failed",
          "shared S247 gate: 44 guarded readers + 27/69 guarded writers; 42 writers open",
          "S255 snapshot/private Task+EL0+JoinHandle build < S354 writer < one mutable alias < one ready_queue.push < writer/IRQ release",
          "production source entry paths=5 direct + 2 transitive; RPi5 runtime observations=0; provider authority=0",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "g8l-s354-selected-regression",
        title: "S354 selected task-publication regression",
        commandLines: [
          "run S354, S353, S352, S255, elf_loader_source, task_lifecycle_source, task_publication_source and task_spawn_asid_source serially",
        ],
        outputLines: [
          "initial historical assertions: S353 39/40 RED; task_publication_source 1/2 RED",
          "strengthened contracts: private x0 before builder result; builder < S354 acquire < alias < publication; exact distinct transaction",
          "final result: 8 groups / 150 passed / 0 failed",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "g8l-s354-production-publication",
        title: "S354 Operations/Timeline/phone production publication",
        commandLines: [
          "npm test && npm run lint && npx tsc --noEmit && npm run build",
          "npm run deploy",
          "cache-busted curl + cmp for /operations/, /timeline/ and /yol-haritasi/",
        ],
        outputLines: [
          "website tests 563/563 PASS; lint PASS; TypeScript exit 0 with empty output; static routes 23/23",
          "export files=194; Timeline/yol-haritasi gate cards=193; S354 policy=9172 chars",
          "initial deployment=936523ab-7d0c-469d-9c56-faabe90a097b; uploaded=110; existing=84",
          "custom domain: three routes HTTP 200 and byte-exact=true",
          "immutable deployment hostname: curl exit 28 / HTTP 000 after 10 seconds",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
    ],
    terminalSessionsNote:
      "S354 yirmi yedinci production writer'ın dar kaynak entegrasyonudur. Yalnız tamamen hazırlanmış general-user Task değerinin tek ready-queue publication sınırı guarded'dır; private fallible preparation writer dışında kalır ve S355 kernel-task spawn bu kapıda tamamlanmış sayılmaz.",
    limitations: [
      "42 production writer aynı shared gate dışında kaldığı için whole-scheduler exclusion ve provider authority açık kalır.",
      "Beş direct ve iki transitive source path wiring kanıtıdır; RPi5-only S354 wrapper için supported-profile invocation/observation kanıtı yoktur.",
      "spawn_kernel_task publication writer sınırı sıradaki ayrı S355 kapısıdır.",
      "Default-parallel PTY determinism, transient-contention liveness/soak, Generic SMP ve fiziksel RPi kabulü açık kalır.",
    ],
  },
snippet sha256: 5397c977612efile sha256: 9726dbf00f84
Focused test komutu
cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s354_general_user_spawn_writer_guard_integration -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S354-General-User-Spawn-Writer-Guard-Integration-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 91d38c7b6222f0b4c117be786454853543da55a160e543d9b951057cc20dcc06