[obsidian] vault backup: 2025-09-22 13:40:38[

This commit is contained in:
2025-09-22 13:40:38 +09:00
parent c52875ef03
commit c7c221bc80
2 changed files with 23 additions and 9 deletions

View File

@@ -65,19 +65,33 @@ delay(3)delay(1) delay(2)
に更新される に更新される
```rust ```rust
enum StateLeaf{ //PartialEqで中身ではなくサイズを比較するようにする
Nested(Box<StateTree>), struct MemoryChunk(Vec<u64>>);
Delay(usize),
Feedback(usize), enum StateNode{
Tree(StateTree),
Delay(MemoryChunk),
FeedBack(MemoryChunk),
External(MemoryChunk)
} }
struct StateTree{ struct StateTree{
children: Vec<StateLeaf> children: Slotmap<Box<StateNode>>
} }
``` ```
途中でchildrenの一部が削除される可能性があって、かつiterateも行うのでSlotmapで良さそう
Delay、feedback、Externalを区別する意味はあるのか→たまたまサイズが同じなDelayとExternalとかはあり得るので区別必要
クロージャの呼び出しの時は?
コンパイル時ではなく、Closure命令でクロージャが作られる際にアロケートとIDの振り分けが起きる クロージャの呼び出しの時は?→コンパイル時ではなく、Closure命令でクロージャが作られる際にアロケートとIDの振り分けが起きる これは諦めて良さそう(適切にやりたければ[[多段階計算]]でコンパイル時に頑張れ)
あとはIDの振り方問題。dspから順番にnon-closure-callをトレースするのは同じとして
```rust
fn update_state_tree(oldtree:StateTree,newtree)->StateTree{
let state_changed = oldtree.children.iter().zip(newtree.children.iter()).all(|oldc,newc|newc == oldc)
}
```
クロージャ