c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5.6 KiB
5.6 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-pointer-compression | Pointer Compression | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Pointer Compression
매 한 줄
"매 64-bit 시스템 위에서 heap pointer를 32-bit 로 줄여 절반 공간으로 저장". 매 V8(2020), Hermes, JVM(CompressedOops, 2008부터) 의 heap memory ~40% 절감 + 매 cache locality 향상. 매 4GB 안 heap 제한 대신 매 typical web app 에는 충분.
매 핵심
매 동기
- 매 64-bit OS 의 V8 heap object 의 80% 가 pointer field 차지.
- 매 pointer = 매 8 bytes 인데 실제 정보 entropy ~32 bits (heap < 4GB).
- 매 절반으로 → 매 RAM↓, 매 GC scan 시간 ↓, 매 L1/L2 cache hit ↑.
매 V8 scheme (post-2020)
- Cage: 매 4GB 정렬된 가상 메모리 reservation.
- Base register / R13: 매 cage base 주소 보관 (cached).
- 32-bit slot: 매 cage 안 offset.
- Smi tagging: 매 31-bit integer 의 inline (1 LSB tag).
- Decompress:
addr = base + (int64_t)(int32_t)compressed.
매 trade-off
- + Heap mem ~30–43% 절감, 매 V8 startup ↓.
- + Cache pressure ↓ → 매 throughput 5-10% ↑.
- − Per-access decompression cost (매 작음, 보통 +1 ALU).
- − Heap 4GB 한계 (매 큰 app 의 큰 process 분할 필요).
- − External pointer 는 sandboxed pointer table 로 indirection 추가.
매 비슷한 system
- JVM CompressedOops: 매 8-byte aligned + shift → 매 32GB heap 까지 32-bit.
- CHERI capabilities: 매 다른 방향 — 매 capability + bounds 로 fat pointer.
- Hermes (RN): 매 32-bit pointer + handle table.
- WebAssembly memory64 vs memory32: 매 동일 motif.
💻 패턴
Compress / decompress (V8 conceptual)
// 매 V8 cage base = 4GB-aligned
inline Address Decompress(uint32_t compressed, Address cage_base) {
return cage_base + static_cast<int64_t>(static_cast<int32_t>(compressed));
}
inline uint32_t Compress(Address full) {
return static_cast<uint32_t>(full); // 매 lower 32 bits
}
// 매 Smi (Small Integer) tagging
constexpr int kSmiTagSize = 1;
inline bool IsSmi(uint32_t v) { return (v & 1) == 0; }
inline int32_t SmiValue(uint32_t v) { return static_cast<int32_t>(v) >> 1; }
Tagged slot in heap object
class HeapObject {
uint32_t map_; // 매 type info, compressed
uint32_t properties_; // 매 compressed
uint32_t elements_; // 매 compressed
// 매 instance fields follow, all 4 bytes each
};
// 매 compare: 64-bit pointer system 에서 same object = 24 bytes header
JVM CompressedOops
# 매 default ON when heap ≤ 32GB on 64-bit JVM
java -XX:+UseCompressedOops -Xmx16g App
# 매 8-byte alignment + 3-bit shift → 매 32-bit reference 가 32GB 까지 cover
java -XX:ObjectAlignmentInBytes=8 ...
Sandboxed external pointers (V8 2024+)
// 매 untrusted external ptr → 매 indirection table
class ExternalPointerTable {
Address entries_[N];
public:
uint32_t Allocate(Address external) {
uint32_t handle = next_++;
entries_[handle] = external;
return handle; // 매 store handle 32-bit, not raw ptr
}
Address Resolve(uint32_t handle) { return entries_[handle]; }
};
Disable pointer compression (V8 build)
# 매 large heap (>4GB) needed
gn args out.gn/x64.release
# v8_enable_pointer_compression = false
ninja -C out.gn/x64.release v8
Hermes 32-bit handle (React Native)
// 매 HermesValue = 64-bit NaN-boxed; pointer 부분은 cage offset 32-bit
struct HermesValue {
uint64_t raw;
bool isPointer() const { return (raw & kTagMask) == kPointerTag; }
HeapPtr getPointer() const { return base_ + (raw & kPayloadMask); }
};
매 결정 기준
| 상황 | Approach |
|---|---|
| Browser tab / Node ≤ 4GB | V8 pointer compression ON (default) |
| Large server-side V8 (>4GB) | Compile with compression OFF or use isolates |
| JVM ≤ 32GB heap | CompressedOops ON (default) |
| JVM > 32GB | UseCompressedOops auto-OFF |
| Mobile JS (Hermes) | Always 32-bit handle |
| Custom GC engine | 매 cage allocator + tagged 4-byte slot 직접 구현 |
기본값: 매 modern engine 의 default ON; 매 disable 은 명백한 large-heap 이유 있을 때만.
🔗 Graph
- 부모: Garbage Collection
- 응용: V8 · Hermes · Chromium
🤖 LLM 활용
언제: 매 V8/JVM/JS-engine 의 heap memory profiling. 매 mobile/tab memory pressure. 언제 X: 매 native-only (Rust/C++) 의 단순 64-bit pointer — 매 자체 GC 없으면 의미 적음.
❌ 안티패턴
- >4GB V8 heap with compression ON: 매 OOM crash. 매 isolate 분할 또는 disable.
- Misaligned cage: 매 4GB align 안 되면 decompress 산술 깨짐.
- External raw pointer in heap: 매 sandbox bypass + crash on heap relocation. → 매 external pointer table 필수.
- Assumption that pointer = 8 bytes in tooling: 매 V8 inspector / heap snapshot tools 가 가정 하면 corrupt read.
🧪 검증 / 중복
- Verified (V8 blog "Pointer Compression in V8" 2020, JVM CompressedOops docs, Hermes design doc).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — V8 cage scheme + CompressedOops + sandboxed external |