agent

a deep dive into codex

Codex looks like a chat interface, but the model is only one component. The useful system is a loop around the model: collect context, ask the model what to do, execute tools, return their …

Read article
cmake

cmake

CUDA_SEPARABLE_COMPILATION Separable compilation allows the compilation of individual CUDA source files (*.cu) into separate object files, which can be linked together later. This can resul…

Read article
gpu

Nvidia cuda dev all in one

NVCCnvcc predefines the following macros: NVCC (1): Defined when compiling C/C++/CUDA source files. CUDACC (1): Defined when compiling CUDA source files. compile a single cuda fil…

Read article
defi

a deep dive into uniswap v3

concentrated liquidityrecap on AMM. the price of asset X is defined as\[ \tag{1}P = y/x\] where y is asset quantity of asset Y, and x is asset quantity of X.since\[ \tag{2}L^{2} = x*y\…

Read article
math

polynomials

IntroductionLet \(A(X)\) be a polynomial over \(\mathbb{F}_p\) with formal indeterminate \(X\). As an example, $$A(X) = a_0 + a_1 X + a_2 X^2 + a_3 X^3$$ defines a degree-\(3\) polynomial. …

Read article
math

multi scalar multiplication (MSM)

ProblemLet \( \mathbb{G}\) be a group of order \(p=2^{\lambda}\)(\(\lambda\) would be the number of bits of the prime). Give \(n\) scalars \(e_i\) and \(n\) EC points \(P_i\), calculate \(P…

Read article
cpp

cpp build

cmakeenvironment variables CMAKE_SOURCE_DIR: the root directory of the source tree for the project. This variable holds the full path to the directory where the top-level CMakeLists.txt fil…

Read article
cryptography

field

Pseudo-Mersenne PrimePseudo-Mersenne Prime is a prime of the form\[ p = 2^m -k \]where \(k\) is an integer for which\[ 0 \lt |k| \lt 2^{\lfloor m/2 \rfloor} \] if \(k=1\), then \(p\) i…

Read article