[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78WX21E5RKXZEZEAEFGCM44":3,"skill-same:01M78WX21E5RKXZEZEAEFGCM44":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":45},"01M78WX21E5RKXZEZEAEFGCM44","training-and-compression",null,"This skill teaches a Researcher to train, compose, inspect, and troubleshoot Faiss compressed and binary indexes while preserving codec, dimension, and backend constraints.","VectorSpaceLab\u002FAREX-Skill","VectorSpaceLab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F180637102?v=4","01M7538C5WPSJGWF7KHR4EFZ9F","01M7538C6R2GFP53NPXTCZNBRT",351,"MIT","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: training-and-compression\ndescription: \"This skill teaches a Researcher to train, compose, inspect, and\n  troubleshoot Faiss compressed and binary indexes while preserving codec,\n  dimension, and backend constraints.\"\ndisable-model-invocation: true\nmetadata:\n  disco-role: operating\nlicense: MIT\n---\n\n# Training and compression\n\nUse this branch when the request involves **training or adding compressed\ncodes**, PQ\u002FSQ\u002FIVF-PQ, residual or additive quantization, RaBitQ, OPQ and\nother transforms, PQ fast scan, standalone codecs, reconstruction, code size,\nor binary\u002FHamming indexes. The CPU baseline is the verified Faiss 1.15.0\npackage (Python >=3.10, NumPy float32 arrays, `OPTIMIZE DD AVX2`). Treat every\nCUDA, cuVS, ROCm, Metal, or SVS claim as conditional until the runtime probe\nin the accelerated sibling succeeds.\n\n## Route first\n\n- For generic exact-versus-approximate index choice, metrics, `nprobe`, and\n  search behavior, read [index-selection-and-search](..\u002Findex-selection-and-search\u002FSKILL.md).\n- For `IndexPreTransform`, ID ownership, selectors, and `IndexRefine*`\n  composition, read [composition-and-filtering](..\u002Fcomposition-and-filtering\u002FSKILL.md).\n- For persistence, ground truth, recall measurement, and benchmark\u002Fevaluation\n  design, read [persistence-and-evaluation](..\u002Fpersistence-and-evaluation\u002FSKILL.md).\n- For GPU-resident codecs or CPU\u002FGPU transfer, read\n  [accelerated-and-interoperable](..\u002Faccelerated-and-interoperable\u002FSKILL.md).\n\nThis branch owns the codec lifecycle and the compressed representation. It\ndoes not choose a general index family, own custom IDs\u002Fselectors, or certify\noptional accelerators.\n\n## Operating procedure\n\n1. Normalize the input as a contiguous `float32` matrix of shape `(n, d)` for\n   float indexes, or a contiguous `uint8` matrix of shape `(n, d \u002F\u002F 8)` for\n   binary indexes. Binary dimension must be a multiple of eight; do not pass\n   unpacked boolean\u002Ffloat bits to an `IndexBinary`.\n2. Select a factory or explicit class only after checking the constraints and\n   code-size formulas in [api-reference.md](references\u002Fapi-reference.md).\n   Keep metric and transform dimensions consistent through the whole chain.\n3. Keep a representative, finite training sample separate from the database.\n   Call `train(training_vectors)` before `add(database_vectors)` whenever\n   `is_trained` is false. Training data needs enough examples for the coarse\n   centroids and every codec; a small smoke may warn, but production training\n   should not ignore those warnings.\n4. Add only vectors with the input dimension expected by the outer index. For\n   an IVF codec, Faiss trains the coarse quantizer and encoder as part of the\n   outer lifecycle; do not manually add to an untrained IVF-PQ\u002FSQ index.\n5. Search with a deliberately chosen `nprobe` (IVF) and `k`; then measure\n   against an exact baseline before trading bits, subquantizers, or probes.\n   Compression changes recall and reconstructed values even when the API\n   succeeds.\n6. If a caller needs bytes, use `sa_encode`\u002F`sa_decode` with `uint8` arrays of\n   exactly `sa_code_size()` columns. `reconstruct` and decoded values are\n   approximations for lossy PQ\u002FSQ\u002FRQ\u002FAQ\u002FRaBitQ codecs; they are not the\n   original vectors. RaBitQ's `sa_decode` is suitable for its IP-oriented\n   codec representation but is explicitly not a reliable L2 reconstruction\n   oracle; use its search path for L2.\n7. For a recall\u002Flatency compromise, first improve the candidate set (for\n   example IVF `nprobe`), then add a refinement stage owned by the composition\n   sibling. Refinement requires a compatible reconstructable\u002Fexact storage\n   choice and must not be used to hide an untrained or dimension-invalid base\n   index.\n8. Run the bundled no-network check when validating a small configuration:\n\n   ```bash\n   python \u002Fpath\u002Fto\u002Ftraining-and-compression\u002Fscripts\u002Fsmoke_codecs.py --help\n   python \u002Fpath\u002Fto\u002Ftraining-and-compression\u002Fscripts\u002Fsmoke_codecs.py\n   ```\n\n   It uses deterministic tiny data and returns nonzero for invalid factory,\n   dimension, metric, or binary input. It is a smoke, not a benchmark.\n\n## Fast scan and optional features\n\nPQ\u002FAQ fast scan is a storage\u002Flayout specialization, not a replacement for\ntraining or recall evaluation. The verified family is 4-bit PQ\u002FAQ with a\nblock size divisible by 32 (default 32); it repacks codes into blocks and may\npad the final block. SIMD dispatch can select a different implementation or a\nscalar fallback. Do not infer that a fast-scan factory is available merely\nbecause the host has a GPU or because an unrelated SIMD level is present.\n\nResidual, additive, product-residual, LSQ, and RaBitQ families expose more\nparameters than the compact examples here. Use the API and workflow tables,\nthen run a tiny CPU trial before adopting one. GPU codec behavior belongs to\nthe accelerated sibling and is unverified by this CPU branch.\n\n## Recovery routing\n\nFor invalid `IVF...`\u002FPQ strings, wrong `d % M`, too few training points,\nunsupported fast-scan blocks, bad byte shapes, or reconstruction surprises,\nstart with [troubleshooting.md](references\u002Ftroubleshooting.md). Preserve the\noriginal failing configuration and error; repair one constraint at a time.\nFor a high-level factory replacement route to the index-selection sibling,\nfor staged refinement route to composition, and for recall\u002Fmemory evidence\nroute to persistence-and-evaluation.\n\n## Bundled references\n\n- [API and representation reference](references\u002Fapi-reference.md)\n- [Training and comparison workflows](references\u002Fworkflows.md)\n- [Troubleshooting and recovery](references\u002Ftroubleshooting.md)\n- [Deterministic codec\u002Fbinary smoke](scripts\u002Fsmoke_codecs.py)\n","# Training and compression\n\nUse this branch when the request involves **training or adding compressed\ncodes**, PQ\u002FSQ\u002FIVF-PQ, residual or additive quantization, RaBitQ, OPQ and\nother transforms, PQ fast scan, standalone codecs, reconstruction, code size,\nor binary\u002FHamming indexes. The CPU baseline is the verified Faiss 1.15.0\npackage (Python >=3.10, NumPy float32 arrays, `OPTIMIZE DD AVX2`). Treat every\nCUDA, cuVS, ROCm, Metal, or SVS claim as conditional until the runtime probe\nin the accelerated sibling succeeds.\n\n## Route first\n\n- For generic exact-versus-approximate index choice, metrics, `nprobe`, and\n  search behavior, read [index-selection-and-search](..\u002Findex-selection-and-search\u002FSKILL.md).\n- For `IndexPreTransform`, ID ownership, selectors, and `IndexRefine*`\n  composition, read [composition-and-filtering](..\u002Fcomposition-and-filtering\u002FSKILL.md).\n- For persistence, ground truth, recall measurement, and benchmark\u002Fevaluation\n  design, read [persistence-and-evaluation](..\u002Fpersistence-and-evaluation\u002FSKILL.md).\n- For GPU-resident codecs or CPU\u002FGPU transfer, read\n  [accelerated-and-interoperable](..\u002Faccelerated-and-interoperable\u002FSKILL.md).\n\nThis branch owns the codec lifecycle and the compressed representation. It\ndoes not choose a general index family, own custom IDs\u002Fselectors, or certify\noptional accelerators.\n\n## Operating procedure\n\n1. Normalize the input as a contiguous `float32` matrix of shape `(n, d)` for\n   float indexes, or a contiguous `uint8` matrix of shape `(n, d \u002F\u002F 8)` for\n   binary indexes. Binary dimension must be a multiple of eight; do not pass\n   unpacked boolean\u002Ffloat bits to an `IndexBinary`.\n2. Select a factory or explicit class only after checking the constraints and\n   code-size formulas in [api-reference.md](references\u002Fapi-reference.md).\n   Keep metric and transform dimensions consistent through the whole chain.\n3. Keep a representative, finite training sample separate from the database.\n   Call `train(training_vectors)` before `add(database_vectors)` whenever\n   `is_trained` is false. Training data needs enough examples for the coarse\n   centroids and every codec; a small smoke may warn, but production training\n   should not ignore those warnings.\n4. Add only vectors with the input dimension expected by the outer index. For\n   an IVF codec, Faiss trains the coarse quantizer and encoder as part of the\n   outer lifecycle; do not manually add to an untrained IVF-PQ\u002FSQ index.\n5. Search with a deliberately chosen `nprobe` (IVF) and `k`; then measure\n   against an exact baseline before trading bits, subquantizers, or probes.\n   Compression changes recall and reconstructed values even when the API\n   succeeds.\n6. If a caller needs bytes, use `sa_encode`\u002F`sa_decode` with `uint8` arrays of\n   exactly `sa_code_size()` columns. `reconstruct` and decoded values are\n   approximations for lossy PQ\u002FSQ\u002FRQ\u002FAQ\u002FRaBitQ codecs; they are not the\n   original vectors. RaBitQ's `sa_decode` is suitable for its IP-oriented\n   codec representation but is explicitly not a reliable L2 reconstruction\n   oracle; use its search path for L2.\n7. For a recall\u002Flatency compromise, first improve the candidate set (for\n   example IVF `nprobe`), then add a refinement stage owned by the composition\n   sibling. Refinement requires a compatible reconstructable\u002Fexact storage\n   choice and must not be used to hide an untrained or dimension-invalid base\n   index.\n8. Run the bundled no-network check when validating a small configuration:\n\n   ```bash\n   python \u002Fpath\u002Fto\u002Ftraining-and-compression\u002Fscripts\u002Fsmoke_codecs.py --help\n   python \u002Fpath\u002Fto\u002Ftraining-and-compression\u002Fscripts\u002Fsmoke_codecs.py\n   ```\n\n   It uses deterministic tiny data and returns nonzero for invalid factory,\n   dimension, metric, or binary input. It is a smoke, not a benchmark.\n\n## Fast scan and optional features\n\nPQ\u002FAQ fast scan is a storage\u002Flayout specialization, not a replacement for\ntraining or recall evaluation. The verified family is 4-bit PQ\u002FAQ with a\nblock size divisible by 32 (default 32); it repacks codes into blocks and may\npad the final block. SIMD dispatch can select a different implementation or a\nscalar fallback. Do not infer that a fast-scan factory is available merely\nbecause the host has a GPU or because an unrelated SIMD level is present.\n\nResidual, additive, product-residual, LSQ, and RaBitQ families expose more\nparameters than the compact examples here. Use the API and workflow tables,\nthen run a tiny CPU trial before adopting one. GPU codec behavior belongs to\nthe accelerated sibling and is unverified by this CPU branch.\n\n## Recovery routing\n\nFor invalid `IVF...`\u002FPQ strings, wrong `d % M`, too few training points,\nunsupported fast-scan blocks, bad byte shapes, or reconstruction surprises,\nstart with [troubleshooting.md](references\u002Ftroubleshooting.md). Preserve the\noriginal failing configuration and error; repair one constraint at a time.\nFor a high-level factory replacement route to the index-selection sibling,\nfor staged refinement route to composition, and for recall\u002Fmemory evidence\nroute to persistence-and-evaluation.\n\n## Bundled references\n\n- [API and representation reference](references\u002Fapi-reference.md)\n- [Training and comparison workflows](references\u002Fworkflows.md)\n- [Troubleshooting and recovery](references\u002Ftroubleshooting.md)\n- [Deterministic codec\u002Fbinary smoke](scripts\u002Fsmoke_codecs.py)\n",{"name":5,"license":14,"metadata":23,"description":7,"disable-model-invocation":25},{"disco-role":24},"operating",true,"main","ac3fe1afa80fb9a09775ecfb2b6cc3ba850a2db6","skills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression",27,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab","2026-09-03 10:25:21",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":25},[35,38,41],{"tool":36,"command":37},"npx","npx skills add VectorSpaceLab\u002FAREX-Skill --skill training-and-compression",{"tool":39,"command":40},"bunx","bunx skills add VectorSpaceLab\u002FAREX-Skill --skill training-and-compression",{"tool":42,"command":43},"pnpm","pnpm dlx skills add VectorSpaceLab\u002FAREX-Skill --skill training-and-compression","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002FSKILL.md",[46,52,56,60],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fapi-reference.md","REFERENCE","参考文档",9609,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002Freferences\u002Fapi-reference.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Ftroubleshooting.md",8382,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002Freferences\u002Ftroubleshooting.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fworkflows.md",9692,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002Freferences\u002Fworkflows.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Fsmoke_codecs.py","SCRIPT","脚本",11144,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ffaiss\u002Fsub-skills\u002Ftraining-and-compression\u002Fscripts\u002Fsmoke_codecs.py",[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M799NYSH1R3RVAHSM2D88Y84","passnet-triton-opt","Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block\u002Fgrid\u002Fwarp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-triton-opt\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M799NS5APEC0N1FZ7XZVW6BN","passnet-solve","END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-solve\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M799NNY9BKSM21V5R7QVTBJX","passnet-skill","PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under .\u002Fpass_dir\u002F, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-skill\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M799NHH6NP7Z1RK77KGXAN6S","passnet-pattern-fusion","Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()\u002Freplacement_args()\u002Freplacement_func() files, when a pass \"failed to match\", or when deciding how to fuse multiple kernels\u002Fops.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-pattern-fusion\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M799ND2J4WNC2PGAZ0A06NDF","passnet-orchestrate","Round\u002Fbatch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep\u002Frevert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-orchestrate\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M799N8SBTMY02ZDG2AZF5ZWE","passnet-feedback","Fast, deterministic feedback for PassNet work: pre-flight pattern\u002Fmatch verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-feedback\u002FSKILL.md",[],[]]