[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75115":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},75115,"tailslayer","LaurieWired\u002Ftailslayer","LaurieWired","Library for reducing tail latency in RAM reads","",null,"C++",2683,152,47,10,0,14,37,142,42,107.05,"Apache License 2.0",false,"main",true,[],"2026-06-12 04:01:17","[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FLaurieWired\u002Ftailslayer)](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Fstargazers)\n[![GitHub forks](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002FLaurieWired\u002Ftailslayer)](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Fnetwork\u002Fmembers)\n[![GitHub contributors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcontributors\u002FLaurieWired\u002Ftailslayer)](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Fgraphs\u002Fcontributors)\n[![Follow @lauriewired](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Flauriewired?style=social)](https:\u002F\u002Ftwitter.com\u002Flauriewired)\n\n\u003Cimg width=\"2490\" height=\"1148\" alt=\"tailslayer3\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F35d6cd98-ab9d-4ea6-8804-dff3a1b8698b\" \u002F>\n\n# Tailslayer\n\nTailslayer is a C++ library that reduces tail latency in RAM reads caused by DRAM refresh stalls. \n\nIt replicates data across multiple, independent DRAM channels with uncorrelated refresh schedules, using (undocumented!) channel scrambling offsets that works on AMD, Intel, and Graviton. Once the request comes in, Tailslayer issues hedged reads across all replicas, allowing the work to be performed on whichever result responds first.\n\n\n\u003Cimg width=\"4986\" height=\"2796\" alt=\"cross_platform_nway\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F4b4a5614-00e4-4845-8a4b-f4adecef5b4d\" \u002F>\n\n## Usage\n\nThe library code is available in [hedged_reader.cpp](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Fblob\u002Fmain\u002Finclude\u002Ftailslayer\u002Fhedged_reader.hpp) and the example using the library can be found in [tailslayer_example.cpp](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Fblob\u002Fmain\u002Ftailslayer_example.cpp). To use it, copy `include\u002Ftailslayer` into your project and `#include \u003Ctailslayer\u002Fhedged_reader.hpp>`. The library currently works with two channels (updates to come!), but full N-way usage is available in the [benchmark](https:\u002F\u002Fgithub.com\u002FLaurieWired\u002Ftailslayer\u002Ftree\u002Fmain\u002Fdiscovery\u002Fbenchmark).\n\nYou provide the value type and two functions as template parameters:\n\n1. **Signal function**: Add the loop that waits for the external signal. This determines when to read. Return the desired index to read, and the read immediately fires.\n2. **Final work function**: This receives the value immediately after it is read. Add the desired value processing code here.\n\n```cpp\n#include \u003Ctailslayer\u002Fhedged_reader.hpp>\n\n[[gnu::always_inline]] inline std::size_t my_signal() {\n    \u002F\u002F Wait for your event, then return the index to read\n    return index_to_read;\n}\n\ntemplate \u003Ctypename T>\n[[gnu::always_inline]] inline void my_work(T val) {\n    \u002F\u002F Use the value\n}\n\nint main() {\n    using T = uint8_t;\n    tailslayer::pin_to_core(tailslayer::CORE_MAIN);\n\n    tailslayer::HedgedReader\u003CT, my_signal, my_work\u003CT>> reader{};\n    reader.insert(0x43);\n    reader.insert(0x44);\n    reader.start_workers();\n}\n```\n\nArguments can be passed to either function via `ArgList`:\n\n```cpp\ntailslayer::HedgedReader\u003CT, my_signal, my_work\u003CT>,\n    tailslayer::ArgList\u003C1, 2>,   \u002F\u002F args to signal function\n    tailslayer::ArgList\u003C2>       \u002F\u002F args to final work function\n> reader{};\n```\n\nYou can also optionally pass in a different channel offset, channel bit, and number of replicas to the constructor. *Note:* Each insert copies the element N times where N is the number of replicas. It does the address calculation work on the backend, allowing tailslayer to act as a hedged vector that uses logical indices. Additionally, each replica is pinned to a separate core, and will spin on that core according to the signal function until the read happens.\n\n## Build the example\n\n```bash\nmake\n.\u002Ftailslayer_example\n```\n\n## Benchmarks and spike timing\n\nThe `discovery\u002F` directory contains supporting code used to characterize DRAM refresh behavior:\n\n- `discovery\u002Fbenchmark\u002F`: Channel-hedged read benchmark\n- `discovery\u002Ftrefi_probe.c`: Spike timing probe for measuring the refresh cycle\n\n```bash\ncd discovery\u002Fbenchmark\nmake\nsudo chrt -f 99 .\u002Fhedged_read_cpp --all --channel-bit 8\n```\n","Tailslayer 是一个用于减少RAM读取过程中由DRAM刷新暂停导致的尾延迟的C++库。它通过在多个独立且刷新时间不相关的DRAM通道间复制数据，并利用未公开的通道混淆偏移技术（适用于AMD、Intel和Graviton处理器），当请求到达时，Tailslayer会在所有副本上发起对冲读取，从而使得工作可以在最先响应的结果上执行。此项目特别适合需要高度优化内存访问性能的应用场景，如高性能计算、低延迟交易系统等，能够显著提升应用程序在极端条件下的表现。",2,"2026-06-11 03:52:23","high_star"]