Skip to content

leafsleuth-ADR-004 - Population-Centered Multidimensional Relative Coordinate Space and SimHash LSH Graph Scaling

Status: Accepted Date: 2026-10-28 Extends: leafsleuth-ADR-001, leafsleuth-ADR-002, leafsleuth-ADR-003

Context

When profiling players across linguistic stylometry, motor micro-kinematics, and gameplay Markov transitions (leafsleuth-ADR-002), two scaling and representation challenges arise on live servers: 1. Unknown Server-Wide Common Similarities & Session-Length Bias: Every server develops its own shared dialect and gameplay loop (e.g., "skyblock", "minion", "ah", /spawn, or MINING -> CONTAINER_SORT). We do not know ahead of time which words, trigrams, commands, or gameplay transitions will be ubiquitous across all players on a particular server. Moreover, a veteran account with 10 hours of playtime has $100\times$ larger raw event counts than an alt account online for 6 minutes. 2. Quadratic $O(N^2)$ All-Pairs Graph Explosion: Evaluating full 4-pillar Bayesian comparisons across $\binom{N}{2}$ account pairs scales quadratically ($N = 1,000 \implies 499,500$ pairs) and inflates false discovery rates if unlinked pairs are tested exhaustively.

We need a mathematical representation that stores player heuristics by relative values so that: - Accounts with similar behavioral/stylometric proportions land in a similar location in a multidimensional coordinate space regardless of session duration; - Server-wide common traits cancel out automatically without knowing ahead of time what the most common similarities between all players will be; and - Candidate neighbor discovery scales sub-quadratically via spatial/hash bucketing.

Decision

Implement RelativeCoordinateSpace and PlayerRelativeEmbedding in net.leaf.sleuth.common.behavior (sleuth-common) alongside targeted statistical upgrades to MotorKinematicsProfiler, LinguisticStylometryProfiler, and LagAttributionEngine:

1. Intra-Player Namespace Relative Normalization

Each profiler (LinguisticStylometryProfiler, MotorKinematicsProfiler, GoalMarkovProfiler) exports scale-invariant features tagged by namespace (lex:, tri:, habit:, cmd:, cadence:, motor:, goal:, spatial:). Within each namespace $m$, feature weights for player $i$ are normalized to unit $L_2$ norm: $$\hat{w}{i, f} = \frac{w$$ This guarantees that a 10-hour session and a 10-minute session with the same relative behavioral proportions produce identical normalized feature vectors, and a chatty player's lexical tokens never drown out their motor kinematics or Markov transitions.}}{\sqrt{\sum_{f' \in m} w_{i, f'}^2}

2. Dictionary-Free Johnson-Lindenstrauss (JL) Random Hyperplane Projection

To embed arbitrary, open-ended features into a fixed $D$-dimensional coordinate space ($D = 16$) and a 64-hyperplane signature without a predefined feature dictionary, each feature key $f$ is hashed via FNV-1a + SplitMix64 into deterministic signed basis vectors $\vec{u}(f) \in \mathbb{R}^D$ and $\vec{h}(f) \in {-1, +1}^{64}$: $$\vec{y}i = \sum} \hat{w{i, f} \cdot \vec{u}(f) \in \mathbb{R}^D, \qquad \vec{H}i = \sum} \hat{w$$ By the Johnson-Lindenstrauss Lemma and Charikar's theorem, relative inner products and angles between arbitrary high-dimensional heuristic profiles are preserved in $\mathbb{R}^D$.} \cdot \vec{h}(f) \in \mathbb{R}^{64

3. Online Population Z-Score Centering, Sybil-Swarm Weighting & Unit Hypersphere Projection

Across all active accounts ($N \ge 8$), RelativeCoordinateSpace computes the empirical sybil-weighted population centroid $\hat{\mu}d = \frac{\sum}^N w_i y_{i,d}}{\sum_{i=1}^N w_i}$ and standard deviation $\hat{\sigmad$ on every coordinate axis $d \in [0, D-1]$ (and hyperplane mean $\hat{\mu}^{(H)}b$), standardizing each player's vector before projecting onto the unit hypersphere $S^{D-1}$: $$z = \frac{y$$ - } - \hat{\mu}_d}{\max(0.05, \hat{\sigma}_d)}, \qquad \vec{v}_i = \frac{\vec{z}_i}{|\vec{z}_i|_2} \in S^{D-1Sybil-Swarm Centroid Protection & Uncentered Anchor Space: To prevent a multi-account bot wave (e.g., 30 bots joining a 40-player server) from pulling $\hat{\mu}_d$ toward the bot swarm's raw feature vector, each account's centroid weight $w_i$ is down-weighted by its uncentered behavioral clone cluster multiplicity ($1 / \text{cloneClusterSize}_i$ when $> 2$ accounts share uncentered cosine $\ge 0.85$ or SimHash Hamming distance $\le 8$), shared IP/subnet cluster size on low-maturity or bot-flagged accounts, and proximity to fixed BannedBehaviorArchetype anchors ($\times 0.10$ when uncentered archetype cosine $\ge 0.55$). Furthermore, BayesianIdentityLinker.evaluateBannedBehaviorProximity evaluates BannedBehaviorArchetype similarity across both centered and uncentered anchor space (uncenteredEmbeddingOf), keeping AUTOMINING_BOT and SCRIPTED_MACRO_CLICKER detection invariant to online population composition. - Automatic Common-Mode Cancellation: Any habit, word, trigram, or gameplay transition shared by the legitimate human population shifts $\hat{\mu}d$ equally for all players and is subtracted to $\vec{0}$ at the origin—without ever needing a static list of common server behaviors. - Idiosyncratic Clustering: Only relative deviations from the server population push two accounts toward the same direction on $S^{D-1}$ ($\cos\theta} = \vec{vA \cdot \vec{v}_B \to 1$, uclidean distance $|\vec{v}_A - \vec{v}_B|2 = \sqrt{2(1 - \cos\theta \to 0$).})

4. Sub-Quadratic Graph Scaling via Multi-Band SimHash LSH & 3D Spatial Cells

Each player's centered hyperplane vector produces a 64-bit Charikar locality-sensitive hash (simHash64, where bit $b = 1 \iff H_{i,b} - \hat{\mu}^{(H)}b \ge 0$) and a quantized 3D spatial cell (spatialCellX, spatialCellY, spatialCellZ) from its first three unit coordinates: - RelativeCoordinateSpace.discoverCandidatePairs indexes accounts into 16 4-bit LSH bands and 3D spatial cells. - Instead of evaluating all $\binom{N}{2}$ pairs in BayesianIdentityLinker.compareAllRegisteredAccounts, only pairs that share an IP or collide across LSH bands / 27-neighbor spatial cells with high relative cosine or low Hamming distance ($\le 24$ bits) undergo full 4-pillar Bayesian evaluation. - Cross-IP prior log-odds scale dynamically with population size ($\text{LogOdds}(N) = -0.85 - 0.35 \ln(N / 25)$ for $N > 25$) to control false discovery rate.}

5. Companion Statistical Upgrades Across Pillars & Lag Attribution

  • Cross-Restart Ban-Evasion Persistence (SleuthProfileStore): Serializes and reloads 4-pillar player behavioral sketches, salted IP hashes, server-wide IDF tables, and banned-account markers (profiles.sleuth) across server restarts without storing raw chat logs, rebuilding RelativeCoordinateSpace on startup so time-shifted ban evaders are caught when they return on a new account or IP.
  • Simultaneous Independent Behavior Alt Filter (SimultaneousActivityCorrelator.isIndependentSimultaneousPair): Filters out account pairs that exhibit sustained simultaneous, uncorrelated active input bursts ($\ge 8$ overlapping 2s buckets, $\ge 35\%$ concurrent dual-active buckets, $r \in [-0.22, +0.35]$), preventing close faction-mates or roommates who play together simultaneously from being falsely flagged as alts.
  • Proximity to Banned Behavior Archetypes (BannedBehaviorArchetype, BannedBehaviorMatch, BotFingerprint): Embeds canonical banned behavior anchors (AUTOMINING_BOT, SCRIPTED_MACRO_CLICKER, LAG_MACHINE_GRIEFER) directly into RelativeCoordinateSpace alongside kinematic cardinal-snap / metronomic cadence, Markov MINING -> MINING self-loop features, and 64-bit quantized BotFingerprint hashes (LookSolverType: HUMAN_QUANTIZED_GCD, AXIS_GRID_SNAP_BOT, TRIGONOMETRIC_ATAN2_PACKET_BOT, STATIC_FIXED_ANGLE_MACRO, plus action period, hotbar slot transition cycle, and state loop) so fresh cheat alts and multi-account bot swarms are caught across VPNs even when silent in chat.
  • Multi-DPI Mouse Sensitivity Mode Clustering & Hotbar Ergonomics (MotorKinematicsProfiler): Sliding-window GCD reduction de-aliases $2\times$/$3\times$ harmonics, clusters up to 3 distinct DPI/sensitivity modes per player so hardware DPI clutch toggles do not poison cross-account matching, tracks $9\times 9$ hotbar slot transition bigrams (motor:slot:a->b) and sneak/offhand cadence, and inverts vanilla Java Edition's cubic sensitivity formula $\delta_{\text{gcd}} = 1.2 (0.6 s + 0.2)^3$ to report the exact 0–200% Mouse Sensitivity slider setting.
  • Residential /24 IPv4 & /64 IPv6 Subnet Correlation & Per-Server Salt (SleuthBehaviorListener, BayesianIdentityLinker): Hashes both exact host addresses (iphash:) and /24 IPv4 / /64 IPv6 network prefixes (subnethash:) with a per-server persistent cryptographic salt (salt.key), assigning an intermediate prior (SHARED_SUBNET_PRIOR_LOG_ODDS = -0.15) and mandatory LSH candidate evaluation across residential router-reboot IP rotations while automatically marking banned accounts on kick/quit/moderation ban commands.
  • Alt-Cluster Lag Attribution & Contraption Fingerprinting (LagAttributionEngine $\leftrightarrow$ BayesianIdentityLinker): Synchronizes causal chunk provenance and periodic contraption signatures (lag:sig:<pattern>@period=<ticks>) into GoalMarkovProfiler and unmasks passive AFK chunk-loader alts (bystanderOnly = false) when BayesianIdentityLinker links them (LIKELY_SAME_PERSON or posterior $\ge 0.75$) to the chunk's causal builder, while preserving bystander immunity for independent roommates.
  • LinguisticStylometryProfiler Compose-Time Linear Fit & Trigram Cosine Delta: Uses EwmaLinearFit to separate reaction latency from mechanical typing speed ($\Delta t \approx \tau_{\text{react}} + \beta L$) and weights character trigrams by server-population IDF (cosineDeltaSimilarity).
  • LagAttributionEngine Online NLMS + EwmaLinearFit Event-Weight Learning & Fork-Agnostic SparkTimingClassifier: Rather than hardcoding event weights (which fails on forks that have already eliminated hopper or redstone wire lag), LagAttributionEngine learns event-class weights (learnedRedstoneWeight, learnedEntityWeight, learnedChunkLoadWeight) online via non-negative Normalized Least Mean Squares (NLMS) and EwmaLinearFit covariance slopes, modulated by SparkTimingClassifier (which probabilistically classifies spark timing nodes and server-thread stack frames across arbitrary server forks into REDSTONE_AND_HOPPERS, ENTITIES_AND_AI, and CHUNK_SYSTEM_AND_IO posterior shares), while subtracting JVM GC pauses and preserving decaying builder provenance.

6. Database-Grade N = 10,000+ Scaling, Bounded Streaming Sketches & Multi-Epoch Concept Drift

  • Inverted Blocking Indexes & 8-Byte SimHash Canopy Sybil Clustering (BayesianIdentityLinker, RelativeCoordinateSpace): Replaces $O(N^2)$ mandatory shared-network pair scans with inverted equivalence buckets (accountsByIpHash, accountsBySubnetHash, and accountsByHardwareGcdCanopy in $O(\sum_b |B_b|^2) = O(N)$) and replaces $O(N^2)$ sybil clone-cluster scans when $N > 128$ with 8-byte SimHash canopy bucketing.
  • Algebraic $O(D)$ Incremental View Maintenance (IVM): RelativeCoordinateSpace maintains running population sums (runningCoordSum, runningCoordSumSq, runningHyperSum, runningTotalWeight) and updates liveEmbeddings in-place (< 10 ms per single-player update at $N = 10,000$), while BayesianIdentityLinker#syncRelativeCoordinateSpace tracks per-account activityStamp digests (lastSyncedTelemetryStamp) so unchanged offline accounts are never re-projected.
  • Bounded LRU Ring + 64-Hash MinHash & Space-Saving Top-$K$ Sketches (GoalMarkovProfiler, LinguisticStylometryProfiler): GoalMarkovProfiler pairs a 256-entry LRU ring buffer with a 64-function MinHash signature (spatialSketchJaccard) so players exploring thousands of chunks retain exact recent stash overlap and bounded Jaccard similarity in < 1 KB; LinguisticStylometryProfiler uses Metwally Space-Saving / IDF-weighted eviction at 512 tokens and 256 trigrams and scales COMMON_MINECRAFT_LEXICON virtual document-frequency priors proportionally with population size ($\max(16, N/7)$).
  • Bitemporal Forward Epoch Decay & Point-in-Time Frozen Ban Snapshots (BayesianIdentityLinker#advanceBehavioralEpoch): Applies exponential forward decay (applyEpochDecay) to active unbanned accounts and prunes decayed secondary GCD windows (< 20% window support) so legitimate players' profiles track hardware/meta shifts over months, while keeping banned accounts (isAccountBanned) frozen at their point-in-time ban snapshot so returning time-shifted ban evaders are caught across multi-epoch horizons (BehavioralIdentityCalibrationTest).

Alternatives Considered

Alternative Why Rejected
Fixed hand-crafted feature vector with static server stopword lists Cannot adapt to new server gamemodes, foreign languages, or emergent slang without manual code changes.
Raw uncentered Euclidean distance on event counts Confounds session duration (playtime) with behavioral identity and allows common server habits to dominate similarity.
Brute-force $O(N^2)$ all-pairs 4-pillar comparison on large servers Scales poorly above $N > 100$ accounts and increases false discovery rate on unlinked pairs.

Consequences

  • Positive:
  • Similar players land in nearby coordinates in RelativeCoordinateSpace regardless of playtime or server-specific slang.
  • Candidate discovery scales sub-quadratically via fast LSH bucket lookups and single-cycle Long.bitCount(simHashA ^ simHashB) Hamming distance checks.
  • Mouse sensitivity is reported as an intuitive 0–200% Minecraft slider percentage while smooth-camera/controller sessions are safely ignored.
  • Negative / Trade-offs:
  • Population centering requires at least 3 active profiles (activeProfiles >= 3) before subtracting the population mean; for 2 accounts, unit-norm relative coordinates are compared directly.