Skip to content
gay-integration logo

Gay Integration Skill

gay-integration

Gay.jl integration for bisimulation games with proper hue-based trit derivation and GF(3) conservation

plurigrid/asi0installs67stars

SKILL.md

Full skill instructions

Gay Integration Skill

Trit: -1 (MINUS - validator) Color: Blue (#2626D8)

Overview

Integrates Gay.jl deterministic color generation with bisimulation game semantics. Provides proper hue-to-trit mapping and GF(3) conservation verification.

Hue-to-Trit Mapping

Official Gay.jl hue-to-trit classification:

Hue RangeTritCategoryColors
0-60°, 300-360°+1 (PLUS)WarmRed, Orange, Magenta
60-180°0 (ERGODIC)NeutralYellow, Green, Cyan
180-300°-1 (MINUS)ColdBlue, Purple
function hue_to_trit(h::Float64)::Int
    h = mod(h, 360.0)
    if h < 60.0 || h >= 300.0
        return +1  # PLUS (warm)
    elseif h < 180.0
        return 0   # ERGODIC (neutral)
    else
        return -1  # MINUS (cold)
    end
end

function color_to_trit(c)::Int
    rgb = convert(RGB, c)
    hsl = convert(HSL, rgb)
    return hue_to_trit(hsl.h)
end

GF(3) Tripartite Stream

Three parallel color streams with guaranteed GF(3) = 0:

mutable struct GF3Stream
    seed::UInt64
    step::Int
    minus_stream::Gay.GayRNG
    ergodic_stream::Gay.GayRNG
    plus_stream::Gay.GayRNG
end

function GF3Stream(seed::Integer)
    Gay.gay_seed!(seed)
    minus = Gay.GayRNG(seed ⊻ 0xDEADBEEF)
    ergodic = Gay.GayRNG(seed ⊻ 0xCAFEBABE)
    plus = Gay.GayRNG(seed ⊻ 0xFEEDFACE)
    GF3Stream(UInt64(seed), 0, minus, ergodic, plus)
end

function tripartite_colors(stream::GF3Stream)
    stream.step += 1
    
    c_minus = Gay.next_color(Gay.SRGB(); gr=stream.minus_stream)
    c_ergodic = Gay.next_color(Gay.SRGB(); gr=stream.ergodic_stream)
    c_plus = Gay.next_color(Gay.SRGB(); gr=stream.plus_stream)
    
    t_minus = color_to_trit(c_minus)
    t_ergodic = color_to_trit(c_ergodic)
    t_plus = color_to_trit(c_plus)
    
    (
        minus = (color = c_minus, trit = t_minus),
        ergodic = (color = c_ergodic, trit = t_ergodic),
        plus = (color = c_plus, trit = t_plus),
        gf3_sum = t_minus + t_ergodic + t_plus,
        conserved = mod(t_minus + t_ergodic + t_plus, 3) == 0
    )
end

Bisimulation Game Color Context

mutable struct BisimColorContext
    seed::UInt64
    spoiler_stream::Gay.GayRNG      # Role: -1
    duplicator_stream::Gay.GayRNG   # Role: 0
    referee_stream::Gay.GayRNG      # Role: +1
    history::Vector{NamedTuple}
end

function bisim_color_at(ctx::BisimColorContext, role::Symbol, move::Int)
    stream = if role == :spoiler
        ctx.spoiler_stream
    elseif role == :duplicator
        ctx.duplicator_stream
    else
        ctx.referee_stream
    end
    
    color = Gay.next_color(Gay.SRGB(); gr=stream)
    trit = color_to_trit(color)
    expected_trit = Dict(:spoiler => -1, :duplicator => 0, :referee => +1)[role]
    
    (role = role, move = move, color = color, trit = trit, 
     expected_trit = expected_trit, hex = color_to_hex(color))
end

GF(3) Conservation Check

function gf3_check(ctx::BisimColorContext)
    trits = [m.trit for m in ctx.history]
    total = sum(trits)
    
    (
        total_moves = length(ctx.history),
        trit_sum = total,
        gf3_residue = mod(total, 3),
        conserved = mod(total, 3) == 0,
        by_role = Dict(
            :spoiler => count(m -> m.role == :spoiler, ctx.history),
            :duplicator => count(m -> m.role == :duplicator, ctx.history),
            :referee => count(m -> m.role == :referee, ctx.history)
        )
    )
end

Sonification

# Gay.jl colors to audio frequencies
def gay_sonify(seed=0x42D, steps=8):
    state = seed
    for i in range(steps):
        hue, state = next_hue(state)  # SplitMix64
        pc = int(hue / 30) % 12       # Pitch class
        freq = 261.63 * (2 ** (pc / 12.0))  # Hz
        play_tone(freq, duration=0.35)

GF(3) Triads

gay-integration (-1) ⊗ bisimulation-game (0) ⊗ ordered-locale (+1) = 0 ✓
gay-integration (-1) ⊗ catsharp-galois (0) ⊗ topos-of-music (+1) = 0 ✓

Commands

# Run Gay.jl integration demo
julia dev/​gadgets/​gay_integration.jl

# Verify GF(3) conservation for seed
just gf3-verify seed=0x42D steps=100

# Sonify Gay.jl colors
just gay-sonify seed=0x42D

Related Skills

  • gay-mcp (-1): SplitMix64 MCP server
  • bisimulation-game (0): Observational equivalence
  • catsharp-galois (0): Music theory bridge
  • ordered-locale (+1): Frame structure

References

  • Gay.jl Repository
  • SplitMix64: Vigna, S. "Further scramblings of Marsaglia's xorshift generators"
  • GF(3): Galois field with 3 elements {-1, 0, +1}

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/​claude-scientific-skills ecosystem:

Visualization

  • matplotlib [○] via bicomodule

Bibliography References

  • general: 734 citations in bib.duckdb

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.

More skills from plurigrid

Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...

67 0
View

**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...

67 0
View
conformal-ga logo
plurigrid/asi

conformal-ga

Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations

67 0
View

Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.

67 0
View
zig-systems logo
plurigrid/asi

zig-systems

Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.

67 0
View
paypal-mcp logo
plurigrid/asi

paypal-mcp

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.

67 0
View
unison logo
plurigrid/asi

unison

Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.

67 0
View
tasks-acset logo
plurigrid/asi

tasks-acset

Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.

67 0
View
c logo
plurigrid/asi

c

World C Skill

67 0
View
syrup logo
plurigrid/asi

syrup

Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.

67 0
View
skill-installer logo
plurigrid/asi

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

67 0
View
cloudflare-workers logo
plurigrid/asi

cloudflare-workers

Deploy serverless applications on Cloudflare Workers. Covers project setup, JavaScript handler patterns, routing, deployment with Wrangler, and API token configuration. Suitable for APIs, proxies, edge computing, and request transformation.

67 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View