## 2 Algorithm Description
### Calculate the Failure Rate of the Evaluated Die
#### 2.1.1 Determination of Effective Space  
1. Processing of evaluated dies with sufficient number of surrounding dies * Set a minimum radius (\(r=3\)) as the initial radius and calculate the failure rate within the current radius: \[\text{Fault Rate}=\frac{\text{Number of Faulty Dies within }r}{\text{Total Number of Dies within }r}\,,\] (1) where the \"Number of Faulty Dies within \(r\)\" is the number of faulty dies within the current radius, and the \"Total Number of Dies within \(r\)\" is the total number of dies within the current radius. * Set a maximum threshold R and dynamically adjust the evaluation radius until the final radius is obtained: Within the range of \(r=3\), if the Fault Rate is less than \(\frac{1}{3}\), expand the radius to \(r+1\). If the Fault Rate is still less than \(\frac{1}{3}\) when the evaluation radius is 4, then extend it to \(r+3\), choosing \(r=7\) as the final radius (if the maximum range of the evaluated die is less than 7, choose the current \(r\) as the final \(r\)). In the range where \(r=3\), if the Fault Rate is less than \(\frac{1}{3}\), expand the radius to \(r+1\), meaning that the evaluated radius is 4; if it exceeds \(\frac{1}{3}\), expand \(r\) outward three times, while each time the Fault Rate is less than \(\frac{1}{3}\), select this time \(r\) for subsequent calculation. If the Fault Rate is greater than \(\frac{1}{3}\), expand \(r\) outward  
Figure 1: Workflow of the proposed method of chip grading.  
three times, and each time, if the Fault Rate is greater than \(\frac{1}{3}\) total, select \(r+3\) for subsequent calculation. Otherwise, extend to \(r=R\).
2. Processing of edge parts During the expansion of the radius, it is necessary to evaluate whether the number of dies within the current radius is sufficient to determine if there are missing dies in certain directions or if the evaluated die is located at the edge of the wafer. For dies located at the edge of the wafer and missing dies in certain directions, the average failure rate of neighboring points is used as virtual data to estimate the average failure rate of a missing part.
* Starting from radius 1, gradually check the actual number of neighboring dies within each radius range. If the data in a certain direction of the edge die are insufficient, calculate the average failure rate (afr) of the currently available neighboring die radius range: \[\text{afr}=\frac{\Sigma\text{ failure state of actual adjacent die}}{\text{the number of actual adjacent dies}},\] (2)
* Dynamically adjust the radius and fill in data. Dynamically calculate and update the average failure rate of neighboring dies according to the evaluation radius at each step. Each time the evaluation radius is expanded, recalculate the average failure rate of all actual neighboring dies within that radius and use these data to fill in the virtual neighboring dies.
* If sufficient neighboring die data are already included within a certain radius range, or further expansion of the radius does not add new actual neighboring dies, expand and judge according to the above steps, determine the final evaluation space, and fill in the missing die data for different radius.  
2.1.3. Calculation of Final Weighted Failure Rate  
Each die has two states: normal (marked as 1) and failed (marked as 0). After determining the evaluation range, perform a weighted calculation of the failure rates of all dies within its range to obtain the weighted failure rate (wfr) of the evaluated die:  
\[\text{wfr}_{i}=\frac{\sum_{j\in\text{neighbors}}(\text{Weight}_{ij}\times \text{state}_{j})}{\sum_{j\in\text{neighbors}}\text{Weight}_{ij}}, \tag{4}\]  
where the state\({}_{j}\) is the state of \(\text{die}_{j}\), with 0 for failure and 1 otherwise. The denominator is the sum of the weights, ensuring that the score is calculated based on relative rather than absolute failure impact. This makes it possible to more fairly assess the influence of neighboring die failures on the central die, while taking distance into account.