[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FAH5YM584PSP0AG02AAYP":3,"skill-same:01M78FAH5YM584PSP0AG02AAYP":73},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78FAH5YM584PSP0AG02AAYP","performance-native",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Native Performance Optimization\n\n## Purpose\nProfile and optimize native CPU, GPU, and memory performance: cycle-level hotspots, cache-miss behavior, allocation churn, data-layout efficiency, and GPU pipeline stalls, with every claim backed by profiler captures before and after.\n\n## Use when\n- Diagnosing frame-time spikes, hitch budgets, or p99 latency regressions in native code (C, C++, Rust, Zig).\n- Reducing L1\u002FL2 cache misses, TLB pressure, branch mispredictions, or allocator contention.\n- Optimizing memory layout (AoS to SoA), SIMD utilization, or multithreaded job-system throughput.\n- Cutting GPU cost: draw calls, overdraw, pipeline state changes, or VRAM bandwidth.\n\n## Do not use when\n- Tuning browser asset caching or web vitals without native profiling (use `performance-web`).\n- Reviewing cache-invalidation topologies or distributed caching layers (use `caching`).\n- Fixing logical correctness bugs that merely look slow; profile first, and if the profile is flat, fix the algorithm choice elsewhere.\n\n## Required context\n- Performance budget: frame-time target (e.g., 16.6 ms at 60 fps with 2 ms hitch ceiling), p50\u002Fp99 latency SLAs, memory ceiling (e.g., 512 MB RSS on console profile).\n- Reproducible workload: benchmark scene, trace capture, or load script that triggers the regression deterministically.\n- Build profile under test: compiler, optimization flags (e.g., clang 18 `-O2 -fno-omit-frame-pointer`), LTO\u002FPGO status, target microarchitecture (e.g., x86-64-v3, Apple M2).\n- Profiler access: `perf`, Tracy, Superluminal, VTune, RenderDoc, or NSight availability on the target machine.\n\n## Procedure\n1. **Reproduce under the profiler**: Capture a 30-second `perf record -g -F 997` (or Tracy frame trace) of the exact regressing workload; record baseline: p50 frame 14.2 ms, p99 frame 21.8 ms, IPC 1.1, L1-D miss 6.4%.\n2. **Apply top-down analysis**: Classify cycles into retiring, bad speculation, frontend-bound, backend-bound (`perf stat -e cycles,instructions,cache-misses,branch-misses`). Attack the largest category first; ignore any function below 2% of total cycles.\n3. **Fix data layout before algorithms**: Convert hot AoS arrays to SoA, shrink hot structs below 64-byte cache lines, replace pointer-chasing (`std::map` node hops) with flat arrays; re-measure L1-D miss rate, targeting below 3%.\n4. **Cut allocation churn**: Replace per-frame `malloc`\u002F`new` in hot loops with arenas, pools, or bump allocators; verify with heaptrack that steady-state frame allocations drop to zero and RSS stays flat across 10,000 frames.\n5. **Parallelize and vectorize deliberately**: Move independent work to the job system with cache-line-padded job structs (no false sharing), then auto-vectorize inner loops (`-Rpass=loop-vectorize` must name the loop); confirm scaling efficiency above 70% from 4 to 8 threads.\n6. **Verify GPU and persist evidence**: Capture RenderDoc frame (draw calls, state changes, overdraw heatmap); assert the fix holds on the slowest declared target, store before\u002Fafter captures, and run `scripts\u002Fverify.sh` to confirm artifact completeness.\n\n## Decision rules\n- **No optimization without a profile**: Changes justified by intuition alone are rejected; every hotspot fix cites a capture with symbol, cycles share, and miss counters.\n- **Measure on the slowest target**: Desktop-only measurements never close a console or mobile performance gate.\n- **Correctness gates stay green**: `-fsanitize=address,undefined` plus the full test suite must pass; a 5% speedup that introduces UB is a regression.\n- **Hitch ceiling is absolute**: Any single frame above the 2 ms over-budget hitch limit fails, even if averages look healthy.\n- **Memory growth must be flat**: Steady-state RSS growth above 1 MB per 10,000 frames blocks the change until the leak or churn source is fixed.\n\n## Evidence required\n- Before\u002Fafter profiler captures (perf.data, Tracy trace, or RenderDoc capture) with p50\u002Fp99 frame times and IPC.\n- `perf stat` counter deltas: cycles, instructions, cache-misses, branch-misses, page faults.\n- heaptrack or sanitizer logs proving zero steady-state allocation churn and no leaks.\n- Completed `templates\u002Fperformance-native-spec.md` with budget table and verdicts.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Performance specification document with budgets, captures, and per-fix deltas.\n- Optimized implementation with layout, allocation, and threading changes isolated per commit.\n- Benchmark harness addition so CI tracks p99 frame time on every merge.\n\n## Stop conditions\n- p99 frame time within budget on the slowest declared target with hitch ceiling held.\n- L1-D miss rate below 3% on hot loops and steady-state allocation churn at zero.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n## Escalation rules\n- Escalate to the lead architect if the budget requires algorithmic redesign (e.g., O(n²) broadphase must become spatial hash) rather than tuning.\n- Escalate to platform owners if the bottleneck is driver, OS scheduler, or hardware errata outside application control.\n- Escalate immediately if profiling reveals memory-safety violations, data races, or thermal throttling that invalidates measurements.\n",{},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".agents\u002Fskills\u002Fperformance-native",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill performance-native",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill performance-native",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill performance-native","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002FSKILL.md",true,[45,51,55,59,65,69],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Fperformance-native-checklist.md","REFERENCE","参考文档",2361,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fchecks\u002Fperformance-native-checklist.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"manifest.json",2240,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fmanifest.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fperformance-native-guide.md",3787,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Freferences\u002Fperformance-native-guide.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fverify.sh","SCRIPT","脚本",4062,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fscripts\u002Fverify.sh",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"templates\u002Fperformance-native-spec.md",2147,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Ftemplates\u002Fperformance-native-spec.md",{"path":70,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":71,"sourceHtmlUrl":72},"templates\u002Fperformance-native-template.md",840,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Ftemplates\u002Fperformance-native-template.md",[74,80,86,93,100,107],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]