hello. Last time I asked about FEE and got an answer, I saw it working, but I have a few more questions.
Condition 1: Set 4 Virtual Sectors (VS) to 16 KB.
Condition 2: set to maximum capacity in multiples of 8 bytes per block


| VS Header (bytes) |
Block Header(bytes) |
Block Payload(bytes) |
|
| 32 | Block1 | 24 | 992 |
| Block2 | 24 | 992 | |
| Block3 | 24 | 992 | |
| Block4 | 24 | 992 | |
| Block5 | 24 | 992 | |
| Block6 | 24 | 992 | |
| Block7 | 24 | 992 | |
| Block8 | 24 | 992 | |
| Block9 | 24 | 992 | |
| Block10 | 24 | 992 | |
| Block11 | 24 | 992 | |
| Block12 | 24 | 992 | |
| Block13 | 24 | 992 | |
| Block14 | 24 | 992 | |
| Block15 | 24 | 992 | |
| Block16 | 24 | 992 | |
| Used VS Length (bytes) | 16288 | ||
| Max VS Length (bytes) | 16384 | ||
I captured the debugging screen as a video, but the size is large, so I upload the situation as a web link.
[ Debug result 1 ]
https://www.youtube.com/watch?v=9mtg-h9e4DM
Summary of results - Debug result 1: failed.
# test 1. write VS1 -> write VS2 (failed. Presumed to be a problem caused by not performing block invalidation)
# test 2. write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4
-> write VS1 -> invalidate VS1 -> write VS2 -> invalidate VS2 -> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2
-> write VS1(??) -> invalidate VS1(??) -> write VS2 -> invalidate VS2....
[ Debug result 2 ]
https://www.youtube.com/watch?v=dL3f87oDIH4
Summary of results - Debug result 2: succeed
# test 3. write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)
-> write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)
-> write VS1 -> invalidate VS1 -> invalidate VS1(re) -> write VS2 -> invalidate VS2 -> write VS3 -> invalidate VS3 -> write VS4 -> invalidate VS4 -> invalidate VS4(re)
If you explain it with a picture, the order will be like this.

For reference, I took a Memory browser dump capture in an Excel file.
[ excel file - Memory browser dump. ]
FEE Virtual Test (debugging).xlsx
Now I have 3 questions.
Q1. In the previous answer, you said that block invalidation is not necessary, but when you allocate 16 blocks with 992 bytes per block and set the total block capacity to approach the capacity of 1 VS, the problem occurs with the following VS as shown in the debug result 1. So, is it correct to invalidate the block when moving to the next VS?
Q2. As in debug result 1, if the block is invalidated after being written only once, VS1 -> VS2 -> VS3 -> VS4 -> VS1 -> VS2 -> VS1 -> VS2 is repeated, and VS3 and VS4 are written only once. .
As in debug result 2, invalidating twice in a row for VS1 and VS4 activations fixed the problem. Is this way right?
Q3. If we didn't set the capacity per block as in condition 2 above, but just set 8 bytes per block, we didn't need to do invalidate after write. In the end, should invalidation be done when there is VS transition, and should not be nullified when there is no VS transition? (If the VS total block capacity is 1/N or less than the capacity of 1 VS, the sector can be written N times without invalidating the block, and the previously written area is automatically invalidated.)
I would like to understand and solve the problem. I would appreciate it if you could answer the three questions.
The source code I tested is attached below.


