\begin{algorithm}[H]
\caption{GNN Propagation with Visibility-Adaptive Residual Blending and Survival Score (cf.\ Eq.~(7)–(10))}
\label{alg:gnn}
\begin{algorithmic}[1]
\Require Gaussian set $\mathcal{S}$, downsampling ratio $r$, neighbor count $k$, learnable residual weight $w_{\text{res}}$, temperature $\tau_s$, pruning threshold $\tau_{\text{prune}}$
\Ensure Updated opacities and SH coefficients for nodes in $\mathcal{V}'$, cached survival scores for pruning
\State $\mathcal{V}' \leftarrow$ uniform downsample of indices with ratio $r$
\State Build $k$-NN graph on $\mathcal{V}'$ via Euclidean pre-selection ($K$) followed by Mahalanobis refinement (Alg.~\ref{alg:build-graph})
\State Construct node features $\mathbf{h}^{(0)}_i$ and edge features $\mathbf{e}_{ij}$, normalize per batch
\For{$\ell=0 \ldots 2$} \Comment{3 GATv2 layers}
  \For{each head $h$}
    \State $\alpha^{(h)}_{ij} \leftarrow \mathrm{softmax}_{j\in\mathcal{N}(i)} \!\Big(\mathbf{a}^{(h)\!\top}\sigma(W^{(h)}[\mathbf{h}_i^{(\ell)} \Vert \mathbf{h}_j^{(\ell)} \Vert U^{(h)}\mathbf{e}_{ij}])\Big)$
  \EndFor
  \State $\mathbf{h}_i^{(\ell+1)} \leftarrow \tanh\!\Big(\Vert_{h}\sum_{j\in\mathcal{N}(i)} \alpha^{(h)}_{ij} V^{(h)}\mathbf{h}_j^{(\ell)}\Big)$
\EndFor
\State \textbf{Prediction:} Predict residuals and survival scores via the MLP head:
\[
\widehat{\boldsymbol{\delta}}_i = [\Delta o_i,\;\Delta \mathbf{k}_i,\; score_i], \quad \forall i\in\mathcal{V}'
\]
\State \textbf{Visibility-adaptive blending:} Compute visibility $v_i \in \{0,1\}$, mean visibility $\bar v=\tfrac{1}{|\mathcal{V}'|}\sum_{i\in\mathcal{V}'} v_i$, and base blend factor $\beta \leftarrow w_{\text{res}}\,(1-\bar v)$
\For{each $i\in\mathcal{V}'$}
  \If{$v_i = 0$} \State $\beta_i \leftarrow 2\beta$ \Else \State $\beta_i \leftarrow \beta$ \EndIf
  \State $(o_i,\mathbf{k}_i) \leftarrow (o_i,\mathbf{k}_i) + \beta_i\,[\Delta o_i,\Delta \mathbf{k}_i]$
\EndFor
\State \textbf{Survival score post-processing:} Map raw $score_i$ to $[0,1]$ via temperature-scaled sigmoid:
\[
{score}'_i \leftarrow \sigma(score_i/\tau_s)
\]
\State \textbf{Caching for pruning:} Scatter ${score}'_i$ back to the full set (non-sampled indices unchanged), updating the model cache ${score}'_i$
\State \textbf{Optional local decision:} Define prune prior $\pi_i \leftarrow 1-{score}'_i$. Mark $i$ as \emph{candidate-to-prune} if $\big(o_i < o_{\min}\big)$ and $\big({score}'_i < \tau_{\text{prune}}\big)$ \Comment{Final pruning is executed during the densify/prune schedule}
\State \Return Updated $\{o_i,\mathbf{k}_i\}_{i\in\mathcal{V}'}$ and cached ${score}'_i$
\end{algorithmic}
\end{algorithm}
