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.5 KiB
5.5 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-timestamp-queries | Timestamp Queries | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Timestamp Queries
매 한 줄
"매 nanosecond-precision GPU timing". WebGPU
timestamp-queryfeature 의 GPU command buffer 안 의 timestamp 의 record 의 pass-level / draw-level latency 의 measure. 매 CPUperformance.now()의 GPU work 의 invisible 의 problem 의 solve, 매 2026 production profiling 의 standard.
매 핵심
매 동작 원리
timestampquery type 의 query set 의 allocate.pass.writeTimestamp(querySet, index)의 command buffer 의 inject.commandEncoder.resolveQuerySet()의 GPU buffer 의 result 의 write.mapAsync(GPUMapMode.READ)의 CPU 의 read — 매 BigInt64Array 의 nanosecond.
매 caveat
- 매 feature flag 의
requiredFeatures: ['timestamp-query']의 device 의 request 의 require. - 매 timestamp resolution 의 driver-dependent — 매 Chrome 의 100ns granularity 의 quantize (privacy).
- 매 GPU clock 의 CPU clock 의 unsynced — 매 absolute time 의 X.
- 매 query result 의 readback 의 1+ frame 의 lag — 매 real-time 의 X 의 best-effort.
매 응용
- Render pass / compute pass 의 cost breakdown.
- Shader optimization 의 before/after 의 measure.
- Adaptive quality (timestamp 의 budget exceed 의 case 의 LOD drop).
- Production telemetry 의 GPU bottleneck 의 detect.
💻 패턴
Request feature
const adapter = await navigator.gpu.requestAdapter();
if (!adapter.features.has('timestamp-query')) {
throw new Error('timestamp-query unsupported');
}
const device = await adapter.requestDevice({
requiredFeatures: ['timestamp-query'],
});
Create query set + buffer
const querySet = device.createQuerySet({ type: 'timestamp', count: 2 });
const queryBuffer = device.createBuffer({
size: 16, // 2 × u64
usage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC,
});
const readBuffer = device.createBuffer({
size: 16,
usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST,
});
Inject into render pass
const pass = encoder.beginRenderPass({
colorAttachments: [...],
timestampWrites: {
querySet,
beginningOfPassWriteIndex: 0,
endOfPassWriteIndex: 1,
},
});
pass.setPipeline(...);
pass.draw(...);
pass.end();
Resolve + readback
encoder.resolveQuerySet(querySet, 0, 2, queryBuffer, 0);
encoder.copyBufferToBuffer(queryBuffer, 0, readBuffer, 0, 16);
device.queue.submit([encoder.finish()]);
await readBuffer.mapAsync(GPUMapMode.READ);
const times = new BigInt64Array(readBuffer.getMappedRange());
const deltaNs = Number(times[1] - times[0]);
console.log(`Pass: ${(deltaNs / 1e6).toFixed(2)} ms`);
readBuffer.unmap();
Three.js helper (r170+)
const renderer = new THREE.WebGPURenderer({ trackTimestamp: true });
await renderer.init();
await renderer.renderAsync(scene, camera);
const renderTime = await renderer.resolveTimestampsAsync(THREE.TimestampQuery.RENDER);
console.log(`Render GPU: ${renderTime} ms`);
Multiple pass labels
const querySet = device.createQuerySet({ type: 'timestamp', count: 6 });
// pass A: index 0, 1
// pass B: index 2, 3
// pass C: index 4, 5
// 매 single resolve 의 batch
Ring buffer 의 frame-over-frame
class GpuProfiler {
constructor(device, frames = 4) {
this.queries = Array.from({ length: frames }, () => ({
set: device.createQuerySet({ type: 'timestamp', count: 2 }),
buf: device.createBuffer({ size: 16, usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST }),
pending: false,
}));
this.frame = 0;
}
acquire() {
const slot = this.queries[this.frame % this.queries.length];
this.frame++;
return slot;
}
}
매 결정 기준
| 상황 | Approach |
|---|---|
| Coarse CPU+GPU 의 frame time | performance.now() + requestAnimationFrame |
| Per-pass GPU breakdown | timestamp-query |
| Shader instruction-level | Chrome WebGPU Inspector / RenderDoc |
| Production telemetry | timestamp-query + sampling (1% session) |
| WebGL fallback | EXT_disjoint_timer_query (degraded, deprecated) |
기본값: 매 WebGPU app 의 production 의 ring-buffered timestamp-query — 매 1-frame lag 의 accept.
🔗 Graph
- 부모: WebGPU
- Adjacent: performance.now
🤖 LLM 활용
언제: 매 GPU bottleneck 의 suspect, 매 pass-level cost 의 attribute 의 want. 언제 X: 매 CPU-bound problem (e.g. JS hot loop) — 매 DevTools profiler 의 use.
❌ 안티패턴
- Sync
mapAsyncawait 의 매 frame: 매 pipeline stall — 매 ring buffer 의 use. - Single timestamp 의 absolute time 의 interpret: 매 GPU clock 의 CPU 의 unsync.
- 100ns 의 below 의 reliance: 매 browser 의 quantize — 매 noise.
- Feature 의 unrequest 의 use: 매
device.createQuerySet의 throw. - Profiler 의 production 의 always-on: 매 overhead minor 의 X 의 budget — 매 sample.
🧪 검증 / 중복
- Verified (W3C WebGPU spec §22 Queries, Chrome WebGPU release notes).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — query set, ring buffer, Three.js integration |