# Intelligent Transaction Scheduling to Enhance Concurrency in High-Contention Workloads
## 5 DrI-Based Executor
### Network Architecture  
We employ distinct networks, \(\pi_{\theta_{1}}(a_{1}|s)\) for operation selection policy and \(\pi_{\theta_{2}}(a_{2}|s,a_{1})\) for thread-worker assignment policy, to guide the transaction-scheduling process. We use a distinct embedding layer for two policies as follows.  
**Graph embedding.** We adopt a \(L\)-layer graph isomorphism network (GIN) [29], a variant of graph neural network (GNN), to compute structural embeddings for \(s_{sc}^{t}\). A GNN is a neural network architecture that operates on graph-structured data by iteratively aggregating feature information from a node's neighbors. In our case, the embedding of each operation is updated at iteration \(l\in\{1,2,\dots,L\}\) as follows:  
\[\mathbf{h}_{l}^{O_{ij}t}=\text{MLP}_{\theta_{l}}\Bigg{(}\Big{(}1+e^{(l)}\Big{)} \cdot\mathbf{h}_{(l-1)}^{O_{ij}t}+\sum_{u\in\mathcal{N}(O_{ij})}\mathbf{h}_{ (l-1)}^{u,t}\Bigg{)} \tag{9}\]  
where \(\mathcal{N}(O_{ij})\) denotes the set of operations that have intra-transaction dependencies with \(O_{ij}\), and \(u\) is one such operation. \(\theta_{l}\) represents the learnable parameters of layer \(l\), and \(\epsilon^{(l)}\) is a trainable scalar that controls the relative weight of self-information and neighbor information during aggregation.  
After \(L\) iterations, we obtain a global representation of the APG using an average pooling function that aggregates the embeddings of all operations into a vector:  
\[\mathbf{h}_{\mathcal{G}}^{t}=\frac{1}{|\mathcal{T}|}\sum_{O_{ij}\in\mathcal{ T}}\mathbf{h}_{L}^{O_{ij}} \tag{10}\]  
We adopt a fully connected layer to encode the thread-worker state \(s_{c}^{t}\) by computing the embedding vector of each thread worker \(h^{C_{k},t}\) and the pooling vector \(u^{t}\).  
**Arc transformation.** APG is a mixed graph containing undirected arcs and directed arcs. For operations with no inter-transactions dependency that has undirected edges, we replace each undirected arc with two directed arcs in opposite directions. We ignore undirected disjunctive arcs in the initial state to reduce computational complexity [30], with \(s_{sc}^{t}=\ \{S(\mathcal{O})^{t},\kappa^{t}\}\) to avoid APG too dense to be efficiently processed by GIN. With the transaction scheduling process, \(\kappa^{t}\) becomes larger since more directed arcs will be added.  
**Action selection.** We implement MLP layers as action decoders based on state embeddings. First, we compute the action score of operation selection action \(\Phi_{1}^{O_{ij},t}\) and thread-worker assignment action \(\Phi_{2}^{C_{k},t}\):  
\[\Phi_{1}^{O_{ij},t}=MLP_{\pi_{\theta_{1}}}(h_{(l)}^{O_{ij},t}|| \mathbf{h}_{\mathcal{G}}^{t}||u^{t}) \tag{11}\] \[\Phi_{2}^{C_{k},t}=MLP_{\pi_{\theta_{2}}}(h^{C_{k},t}||\mathbf{h} _{\mathcal{G}}^{t}||u^{t})\]  
For operations that are already scheduled or violate precedence constraints, or thread workers that are incompatible with the selected operation. We set their score to \(-\infty\). Finally, we normalize the scores using the softmax function, a standard transformation that convertsreal-valued inputs into a probability distribution. This enables the computation of selection probabilities and supports a sampling-based strategy for action prediction.  
\[\begin{split} P_{\mathrm{O}_{ij}}(a_{1}^{t})&=\frac{e^{ \Phi^{\mathrm{O}_{ij}t}}}{\sum_{T}e^{\Phi^{\mathrm{O}_{ij}t}}}\\ P_{\mathrm{C}_{k}}(a_{2}^{t})&=\frac{e^{\Phi^{ \mathrm{C}_{k}t}}}{\sum_{C}e^{\Phi^{\mathrm{C}_{k}t}}}\end{split} \tag{12}\]