physics_in_parallel 4.2.0-alpha

High-performance infrastructure for numerical simulations in physics
Documentation
//! Reserved PiP stream domains. Existing numeric identities remain unchanged.

pub const SOURCE_COORDINATE: u64 = 0x20dd_7f45_5d92_4a31;
pub const INDEPENDENT_SOURCE_SITE: u64 = 0x5fc7_f80b_2257_ae21;
pub const INDEPENDENT_TARGET_SITE: u64 = 0xe895_319d_634c_c4d3;
pub const HAAR_COMPONENT: u64 = 0x64a4_a4fe_1a89_827d;
pub const KERNEL_SAMPLE: u64 = 0xbeb3_9487_4b9c_a7f5;
pub const LATTICE_INITIALIZATION: u64 = 0xc762_ba71_b5a7_8f31;
pub const INDEXED_SHUFFLE: u64 = 0x899f_2c5e_12bd_ba4d;
pub const LANGEVIN_NORMAL: u64 = 0xc7c7_d252_9b53_6071;
pub const MAXWELL_BOLTZMANN_COMPONENT: u64 = 0xf4d4_b301_9eab_6342;
pub const UNIFORM_COMPONENT: u64 = 0x6f42_8f31_98f7_067a;
pub const UNIFORM_CENTERED_COMPONENT: u64 = 0xb4ac_a77c_e8df_b5f1;
pub const GAUSSIAN_COMPONENT: u64 = 0x15eb_0cc7_aac5_7548;
pub const JITTER_COMPONENT: u64 = 0xcbef_a4d0_a194_0f13;
pub const PAIRING_MIXTURE: u64 = super::domain("physics_in_parallel.pairing.mixture.v1");
pub const COUNT_PLACEMENT: u64 = super::domain("physics_in_parallel.sampling.count_placement.v1");

/// PiP reserves these values; named application domains must avoid them.
/// Mixture branch choices additionally use the component coordinate for the
/// node's deterministic preorder index within the pairing configuration.
pub const RESERVED: &[(&str, u64)] = &[
    ("source_coordinate", SOURCE_COORDINATE),
    ("independent_source_site", INDEPENDENT_SOURCE_SITE),
    ("independent_target_site", INDEPENDENT_TARGET_SITE),
    ("haar_component", HAAR_COMPONENT),
    ("kernel_sample", KERNEL_SAMPLE),
    ("lattice_initialization", LATTICE_INITIALIZATION),
    ("indexed_shuffle", INDEXED_SHUFFLE),
    ("langevin_normal", LANGEVIN_NORMAL),
    ("maxwell_boltzmann_component", MAXWELL_BOLTZMANN_COMPONENT),
    ("uniform_component", UNIFORM_COMPONENT),
    ("uniform_centered_component", UNIFORM_CENTERED_COMPONENT),
    ("gaussian_component", GAUSSIAN_COMPONENT),
    ("jitter_component", JITTER_COMPONENT),
    ("pairing_mixture", PAIRING_MIXTURE),
    ("count_placement", COUNT_PLACEMENT),
];

#[cfg(test)]
mod tests {
    #[test]
    fn named_domains_and_reservations_are_stable_and_distinct() {
        assert_eq!(super::super::domain(""), 0xcbf2_9ce4_8422_2325);
        assert_eq!(super::super::domain("hello"), 0xa430_d846_80aa_bd0b);
        for (index, (name, value)) in super::RESERVED.iter().enumerate() {
            for (other_name, other) in &super::RESERVED[..index] {
                assert_ne!(value, other, "{name} collides with {other_name}");
            }
        }
    }
}