<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>B.Sc. in Aerospace Engineering on Bassem Girgis</title>
        <link>https://www.girgis.me/work/aerospace/bsc-cairo/</link>
        <description>Recent content in B.Sc. in Aerospace Engineering on Bassem Girgis</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-US</language>
        <lastBuildDate>Sat, 01 May 2004 00:00:00 +0000</lastBuildDate><atom:link href="https://www.girgis.me/work/aerospace/bsc-cairo/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>A git mirroring tool, rebuilt with a coding agent</title>
        <link>https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/</link>
        <pubDate>Thu, 26 Nov 2026 00:00:00 +0000</pubDate>
        
        <guid>https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/</guid>
        <description>&lt;img src="https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/cover.png" alt="Featured image of post A git mirroring tool, rebuilt with a coding agent" /&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/pygitmirror/pygitmirror&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;pygitmirror&lt;/a&gt; began in 2024 as
a small package with one job: clone a repository from one git server and
push its branches to another, the kind of chore a &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/work/hpc/home-lab/&#34; &gt;home
lab&lt;/a&gt; with its own Gitea server keeps creating. In
November 2026 I rebuilt it with a coding agent, Claude Code, the same way I
rebuilt &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/&#34; &gt;pysqlx and
samplepaths&lt;/a&gt;: I set
the rules and reviewed every pull request, and the agent wrote the code,
the tests and the documentation.&lt;/p&gt;
&lt;p&gt;This project tested the approach on harder ground than the two libraries. A
mirroring tool holds tokens that can read and write every repository of an
account, runs git on addresses it is given, and can overwrite or delete
branches on a server. A mistake here is not a wrong number; it is a leaked
token or a lost branch.&lt;/p&gt;
&lt;p&gt;The short version: version 0.2.1 copies branches and tags between GitHub,
GitLab, Gitea, Forgejo, Bitbucket and any other git server; it has a
command, a Python library, a page that runs on your own machine and a
Docker image; it needs nothing but Python and git; and it has 453 tests,
plus a check against real Gitea servers on every pull request.&lt;/p&gt;
&lt;h2 id=&#34;what-it-does&#34;&gt;What it does&lt;/h2&gt;
&lt;p&gt;pygitmirror has three operations, which differ in what they are allowed to
destroy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;clone&lt;/strong&gt; only adds. It creates missing repositories, adds branches and
tags, and moves branches forward, but fails rather than overwrite
anything that differs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;sync&lt;/strong&gt; makes the destination equal to the source, deletions included.
It is the one to run from cron to keep a copy current, and it refuses to
empty a destination because the source came back empty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;migrate&lt;/strong&gt; copies like clone, then lists the destination again to verify
it, and can archive the source so it becomes read-only. It never deletes
the source.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every operation has a dry run that changes nothing, and missing destination
repositories are created with the description and visibility of the source.
A repository that has not changed costs two short requests and no download,
so syncing a whole organization every night is cheap.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;GIT_MIRROR_SOURCE_TOKEN&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;...       &lt;span class=&#34;c1&#34;&gt;# a GitHub token&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;GIT_MIRROR_DESTINATION_TOKEN&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;...  &lt;span class=&#34;c1&#34;&gt;# a Gitea token&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git-mirror sync --source github &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    --destination gitea --destination-url https://git.example.com &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    --org my-org --all
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;git-mirror serve&lt;/code&gt; opens the same operations as a page on your own machine:
choose two servers, list the repositories, preview, and run.&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 209; 
			flex-basis: 501px&#34;
	&gt;
	&lt;a href=&#34;https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/preview-results.png&#34; data-size=&#34;1898x908&#34;&gt;&lt;img src=&#34;https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/preview-results_hu_1729b45d28423804.png&#34;
			width=&#34;1898&#34;
			height=&#34;908&#34;
			srcset=&#34;https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/preview-results_hu_98d6b60a0a6b36eb.png 480w, https://www.girgis.me/p/a-git-mirroring-tool-rebuilt-with-a-coding-agent/preview-results_hu_1729b45d28423804.png 1024w&#34; sizes=&#34;(min-width: 760px) 720px, 100vw&#34;
			fetchpriority=&#34;high&#34;
			alt=&#34;The results of a preview: how many repositories would be created, updated and deleted, and one row per repository&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;The results of a preview: how many repositories would be created, updated and deleted, and one row per repository&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;h2 id=&#34;how-it-is-built&#34;&gt;How it is built&lt;/h2&gt;
&lt;p&gt;Copying a repository has two halves that have nothing in common. The git
data moves through git, which every host speaks the same way. The
repository itself, its existence, description, visibility and default
branch, is managed through each host&amp;rsquo;s own API. The package keeps the two
apart:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git&lt;/code&gt;&lt;/strong&gt; knows git and no host. It runs the &lt;code&gt;git&lt;/code&gt; executable directly,
not a git library, and keeps a bare local mirror of each repository.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;hosts&lt;/code&gt;&lt;/strong&gt; knows the hosts and no git: one class per provider over a
small HTTP client written on the standard library, with GitHub and Gitea
sharing most of their code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;mirror&lt;/code&gt;&lt;/strong&gt; combines them into the operations. It compares the branches
and tags of both sides into a plan, checks for divergence before pushing
instead of leaving it to git, and reports a result per repository.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;cli&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;web&lt;/code&gt;&lt;/strong&gt; are two ways in: the command, and the page with
its small server and plain JavaScript, with no framework.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The rules of the code base are the same as in the other projects: one class
per module, no file over 300 lines, strict mypy, and a record of 34 design
decisions, each with the alternative that was rejected and why. The package
has no dependencies at run time; the 0.0 versions depended on GitPython,
which the rebuild replaced with the git executable.&lt;/p&gt;
&lt;h2 id=&#34;security&#34;&gt;Security&lt;/h2&gt;
&lt;p&gt;As with my other packages, no independent firm has audited pygitmirror.
What it has is a threat model written down in its &lt;a class=&#34;link&#34; href=&#34;https://pygitmirror.readthedocs.io/en/latest/project/security.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;security
page&lt;/a&gt;,
with the defense for each threat and where in the code it lives:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Area&lt;/th&gt;
					&lt;th&gt;What could go wrong&lt;/th&gt;
					&lt;th&gt;What prevents it&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;Tokens&lt;/td&gt;
					&lt;td&gt;a token in a URL, which git stores and prints&lt;/td&gt;
					&lt;td&gt;no URL with a token is ever built; git gets the token as an HTTP header in the environment of one command&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Tokens&lt;/td&gt;
					&lt;td&gt;a token in the process list, a file, a log or the shell history&lt;/td&gt;
					&lt;td&gt;headers go in the environment, nothing writes a token, logs pass through redaction, and the command reads tokens from environment variables only&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Tokens&lt;/td&gt;
					&lt;td&gt;a redirect that carries the token to another server&lt;/td&gt;
					&lt;td&gt;the API client follows no redirect off its own server&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Input&lt;/td&gt;
					&lt;td&gt;a repository name that escapes the mirror folder or reads as a git option&lt;/td&gt;
					&lt;td&gt;names are checked where they enter: no &lt;code&gt;..&lt;/code&gt;, no leading hyphen&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Input&lt;/td&gt;
					&lt;td&gt;an address that makes git run a command&lt;/td&gt;
					&lt;td&gt;git runs without a shell and with the &lt;code&gt;ext&lt;/code&gt; transport disabled&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;The page&lt;/td&gt;
					&lt;td&gt;another machine, another user, or a website in the same browser&lt;/td&gt;
					&lt;td&gt;it listens on 127.0.0.1, needs a random access key kept in a cookie scripts cannot read, accepts only same-site JSON requests and refuses foreign host names, which stops DNS rebinding&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;The page&lt;/td&gt;
					&lt;td&gt;injected script&lt;/td&gt;
					&lt;td&gt;a content policy that allows the page&amp;rsquo;s own files only, and nothing inline&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;The image&lt;/td&gt;
					&lt;td&gt;a compromised container&lt;/td&gt;
					&lt;td&gt;Alpine with Python, git and the SSH client only; runs as a user that is not root, with a read-only file system&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Around that: ruff runs bandit&amp;rsquo;s security rules on every change, CodeQL
scans the code and the workflows (no open alerts in November 2026),
workflows have read-only permissions unless a job needs more, Dependabot
updates the actions and the base image, releases reach PyPI through trusted
publishing, and &lt;code&gt;SECURITY.md&lt;/code&gt; explains how to report a vulnerability
privately.&lt;/p&gt;
&lt;h2 id=&#34;next-to-other-tools&#34;&gt;Next to other tools&lt;/h2&gt;
&lt;p&gt;There are several ways to copy repositories between servers, and
pygitmirror is the youngest of them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mirroring built into the servers.&lt;/strong&gt; Gitea and Forgejo can pull or push
a mirror, and GitLab can mirror a project to another server. They are the
simplest choice for a few repositories on a server you control, but they
are configured per repository, and the server keeps the credentials.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git clone --mirror&lt;/code&gt; and &lt;code&gt;git push --mirror&lt;/code&gt;&lt;/strong&gt; in a script. Nothing to
install, but a mirror push overwrites and deletes everything at the
destination, the destination repositories usually have to exist already,
and the token often ends up in a URL.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/gabrie30/ghorg&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;ghorg&lt;/a&gt;&lt;/strong&gt; clones or backs up every
repository of an organization or user into one directory, from GitHub,
GitLab, Bitbucket and more. It is mature and widely used, with more than
2,000 stars, and its target is a disk, not another server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/cooperspencer/gickup&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;gickup&lt;/a&gt;&lt;/strong&gt; backs up
repositories from many hosts and can push them to other hosts. It is also
mature, with about 1,500 stars, and written in Go.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;pygitmirror&amp;rsquo;s place among them: host to host with the destination
repositories created as needed, three operations with different powers to
destroy and a preview for each, verification and archiving for a migration,
tokens kept out of every URL and file, and no dependencies beyond Python
and git. It does not copy issues, pull requests, wikis, releases or Git LFS
files, and it is a one-maintainer project with no track record yet.&lt;/p&gt;
&lt;h2 id=&#34;working-with-the-agent-again&#34;&gt;Working with the agent, again&lt;/h2&gt;
&lt;p&gt;The process was the one from the earlier post: instructions for coding
agents in &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt; with a &lt;code&gt;CLAUDE.md&lt;/code&gt; that points
to it, &lt;code&gt;make check&lt;/code&gt; as the definition of done, a pull request for each
change with a verification section, and me reviewing and merging. Seven
pull requests added about 14,000 lines of code, tests and documentation.&lt;/p&gt;
&lt;p&gt;Two things stood out on this project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The agent was honest about what it could not test.&lt;/strong&gt; The first rebuild
could not use tokens on real accounts, and the pull request said so
plainly: creating repositories, setting the default branch, archiving and
token authentication had been tested against stand-ins only, while reading
and listing public repositories had been checked against github.com,
gitlab.com, gitea.com and bitbucket.org. The next pull request closed most
of that gap with something repeatable: &lt;code&gt;make check-gitea&lt;/code&gt; starts two Gitea
servers in containers, creates tokens and copies between them, and it now
runs on every pull request. A self-managed GitLab in a container was tested
by hand, and the pull request says that too.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Security was written down, not assumed.&lt;/strong&gt; The page that can use tokens
arrived in the same pull request as the threat model that protects it, and
the rule that no token may reach a file, a URL, a command line, a log or
the browser&amp;rsquo;s storage is a checklist item on every pull request since. This
is the patient kind of work the agent did well: following where a token or
a name can travel, and writing the security page in a form a reviewer can
check line by line.&lt;/p&gt;
&lt;p&gt;What I take from three projects now: a coding agent is most useful where
the work is careful rather than clever, and it is trustworthy when the
project says precisely what correct means and the agent reports, as plainly
as its successes, what it did not verify.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>From CFD to seismic</title>
        <link>https://www.girgis.me/p/from-cfd-to-seismic/</link>
        <pubDate>Wed, 25 Nov 2026 00:00:00 +0000</pubDate>
        
        <guid>https://www.girgis.me/p/from-cfd-to-seismic/</guid>
        <description>&lt;p&gt;In July 2017 I left ANSYS, after four years on parallel solvers for
computational fluid dynamics, and joined Shell as a senior C++ developer. I
built backend features for a cloud-native application that brings
large-scale seismic processing, before and after stacking, to a
geoscientist&amp;rsquo;s web browser.&lt;/p&gt;
&lt;p&gt;On paper it looked like a jump from one industry to another. It was the
move that turned me from an engineer who writes software into a software
engineer, and I made it for four reasons.&lt;/p&gt;
&lt;h2 id=&#34;the-same-physics-in-a-new-field&#34;&gt;The same physics in a new field&lt;/h2&gt;
&lt;p&gt;Seismic data is the record of waves. A source sends sound into the ground,
the layers below reflect it, and receivers at the surface record the
echoes. A reflection that arrives at time t₀ straight below the source
arrives later at a receiver farther away, along the hyperbola t² = t₀² +
x²/v², and stacking adds up the traces along those curves so that the
reflections stand out from the noise.&lt;/p&gt;
&lt;p&gt;That is the world I came from. Compressible flow is wave propagation too:
the FDV method I worked on through my master&amp;rsquo;s and Ph.D. is built for
equations that carry waves and shocks, and my Ph.D. years included work on
unsteady turbulent flows and acoustics, down to testing boundary conditions
with an acoustic pulse in a box: a constant-pressure boundary, a
characteristic boundary and an adiabatic wall. At Shell my job was the
software around the processing, not the geophysics, but I understood what
the data meant and why it had to be handled the way it was.&lt;/p&gt;
&lt;h2 id=&#34;data-at-a-bigger-scale&#34;&gt;Data at a bigger scale&lt;/h2&gt;
&lt;p&gt;At ANSYS the hard problem was distributing one simulation: splitting a mesh
over thousands of processes and keeping them busy, up to more than 100,000
cores on Oak Ridge&amp;rsquo;s Titan supercomputer. At Shell the hard problem was the
data. The backend loaded terabytes of seismic data into memory across a
Linux HPC cluster, so that it could be stacked and displayed on the fly,
for many users at once.&lt;/p&gt;
&lt;p&gt;That is a different kind of scale. A solver run owns its cluster for hours;
an interactive application shares it with everyone who opens a project, and
each of them expects an answer while they wait.&lt;/p&gt;
&lt;h2 id=&#34;the-full-stack&#34;&gt;The full stack&lt;/h2&gt;
&lt;p&gt;A solver is mostly one program. The Shell application was a system:
low-latency C++ libraries for the numerical work, services that talked to
each other through protobuf and gRPC, Redis and MongoDB, and a web browser
at the other end. I worked across all of it, and some of the hardest bugs I
have tracked down lived in the gaps between those parts, where a
distributed system fails in ways no single component explains.&lt;/p&gt;
&lt;p&gt;That breadth is what I use most today, building risk systems for trading.&lt;/p&gt;
&lt;h2 id=&#34;pure-software-against-my-formal-education&#34;&gt;Pure software, against my formal education&lt;/h2&gt;
&lt;p&gt;Every degree I hold is in engineering: aerospace engineering at Cairo
University and Georgia Tech, engineering mechanics at Cairo, and mechanical
engineering for my Ph.D. At ANSYS I was already a software developer, but
of a physics solver, where that education was the point. The Shell role was
software engineering, plainly, with no solver at its center, and I took it
on purpose.&lt;/p&gt;
&lt;p&gt;I had taught myself software the way I learn most things: by reading, by
building, and by fixing what I used. In 2016 and 2017 I fixed a casting
warning in SWIG and wrote a Protocol Buffers builder for the SCons build
system. In May 2018, while at Shell, I scored 98 out of 100 on the IKM
C++11 ISO standard assessment, in the top 3%. A formal education in
engineering, and a self-taught one in software that reaches the
professional top: I have found that combination to be an advantage, not a
gap.&lt;/p&gt;
&lt;h2 id=&#34;what-came-next&#34;&gt;What came next&lt;/h2&gt;
&lt;p&gt;Seismic processing was the last step before quantitative finance. Fifteen
months later I joined BP to build quant analytics, and &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/p/from-hpc-to-quant/&#34; &gt;From HPC to
quant&lt;/a&gt; is the story of that move. The roles of these
years are on the &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/work/hpc/&#34; &gt;HPC software&lt;/a&gt; page.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>From HPC to quant</title>
        <link>https://www.girgis.me/p/from-hpc-to-quant/</link>
        <pubDate>Wed, 25 Nov 2026 00:00:00 +0000</pubDate>
        
        <guid>https://www.girgis.me/p/from-hpc-to-quant/</guid>
        <description>&lt;p&gt;In 2018 I left HPC software for quantitative finance. Until then I had
spent five and a half years at ANSYS and Shell building the machinery that
other people&amp;rsquo;s simulations run on: parallel solvers that scaled from one
CPU to more than 100,000 cores, and a backend that streams terabytes of
seismic data across a cluster. Then I joined BP as a front-office quant
developer, and today I build risk infrastructure and models for energy
trading at ExxonMobil.&lt;/p&gt;
&lt;p&gt;People sometimes read that as a change of career. To me it was the next
step of the same one, for three reasons.&lt;/p&gt;
&lt;h2 id=&#34;back-to-building-models&#34;&gt;Back to building models&lt;/h2&gt;
&lt;p&gt;My career started with models, not infrastructure: the quasi-1D gas
dynamics model of the hybrid rocket engine my senior design team built at
Cairo University is what pulled me toward computation. After that came the
FDV method for compressible flow, large-eddy simulation of a combustion
actuator, and plasma dynamics for my Ph.D.: years of turning equations into
numbers I could trust.&lt;/p&gt;
&lt;p&gt;HPC moved me one layer down. At ANSYS the question was no longer what to
compute but how to compute it on 100,000 cores: domain decomposition,
algebraic multigrid, Krylov solvers, parallel I/O. I enjoyed that work, and
it taught me most of what I know about performance. But the models
themselves belonged to someone else.&lt;/p&gt;
&lt;p&gt;Quantitative finance brought me back to them. Pricing and risk are
simulation problems: stochastic processes instead of conservation laws,
Monte Carlo paths instead of meshes, distributions of outcomes instead of a
single flow field. The questions are the ones I asked about the FDV method.
Is the scheme right? Does it converge? Which number in the output can be
trusted, and how far?&lt;/p&gt;
&lt;h2 id=&#34;the-same-full-stack-on-demanding-problems&#34;&gt;The same full stack, on demanding problems&lt;/h2&gt;
&lt;p&gt;Leaving HPC did not mean leaving computation behind. Quant analytics is
computationally demanding in its own way, and it uses everything I had
built up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;C++ and Python together.&lt;/strong&gt; At BP I designed and built a Quantitative
Analytics Framework in Python and C++ from scratch, a project with a
budget of more than $3 million. Several internal teams adopted it after
its first release, and their requests filled a two-year roadmap.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clusters and the cloud.&lt;/strong&gt; The habits of MPI, from partitioning the work
to keeping every core busy, carry over to distributed processing with
Databricks and Dask, and to services on Kubernetes and AWS EKS. At BP I
also led the move of several analytics products to the cloud.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data at scale.&lt;/strong&gt; The Shell backend taught me to keep terabytes in
memory across a cluster for many users at once. Market data and risk
results are smaller, but they are needed by many people at the same time,
and always fast.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The full stack matters because a model is only useful once it runs: on
current data, at the size of a real portfolio, inside a system that people
depend on.&lt;/p&gt;
&lt;h2 id=&#34;the-mathematical-side&#34;&gt;The mathematical side&lt;/h2&gt;
&lt;p&gt;Quant analytics also appeals to the academic side of me. Pricing and risk
rest on probability and stochastic calculus, and on the same numerical
analysis I used for my Ph.D.: discretizing equations, controlling error,
knowing when a result has converged. The difference is that the results are
used the same day.&lt;/p&gt;
&lt;p&gt;That interest does not stop at work. Outside it, I maintain
&lt;a class=&#34;link&#34; href=&#34;https://github.com/samplepaths/samplepaths&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;samplepaths&lt;/a&gt;, a library that
generates sample paths of 68 stochastic processes, the raw material of
Monte Carlo models. Its results are checked against an independent
implementation in Rust, the way I learned to check a CFD code against a
known solution; &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/&#34; &gt;the post on rebuilding
it&lt;/a&gt; describes how.&lt;/p&gt;
&lt;h2 id=&#34;systems-that-cannot-go-down&#34;&gt;Systems that cannot go down&lt;/h2&gt;
&lt;p&gt;The last reason is the one I expected least. A simulation on a
supercomputer is a batch job: if it fails at 3 a.m., it is resubmitted, and
the result arrives a little later. Analytics for trading work under
different rules. They have to be available when the market moves, answer
many users at once, and give the same answer every time.&lt;/p&gt;
&lt;p&gt;High availability under high demand is an engineering problem I find as
interesting as scaling a solver. It asks for the same discipline, measuring
before optimizing, testing the parts that fail rarely, and keeping results
reproducible, applied to a system that never stops.&lt;/p&gt;
&lt;h2 id=&#34;what-it-adds-up-to&#34;&gt;What it adds up to&lt;/h2&gt;
&lt;p&gt;Looking back, the move from HPC to quant was less a turn than a return: to
building models, with the infrastructure skills I gained along the way, for
people who need the answer now. The &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/work/quant/&#34; &gt;quantitative finance and
risk&lt;/a&gt; page has the roles, and the &lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/work/hpc/&#34; &gt;HPC software&lt;/a&gt;
page the years that led to them. The step before this one is in
&lt;a class=&#34;link&#34; href=&#34;https://www.girgis.me/p/from-cfd-to-seismic/&#34; &gt;From CFD to seismic&lt;/a&gt;.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>Two Python libraries, rebuilt with a coding agent</title>
        <link>https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/</link>
        <pubDate>Wed, 25 Nov 2026 00:00:00 +0000</pubDate>
        
        <guid>https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/</guid>
        <description>&lt;p&gt;Two of my Python packages had been standing still. pysqlx, a small SQL
library I wrote in 2022, had not changed since its first release.
samplepaths, first published as pystochastic, is my fork of &lt;code&gt;stochastic&lt;/code&gt;, a
well-liked library of stochastic processes by Christopher Flynn that was
last released in 2022 and does not install next to NumPy 2.&lt;/p&gt;
&lt;p&gt;In 2026 I rebuilt both with a coding agent, Claude Code, doing most of the
typing. I set the rules, chose what to build and reviewed every pull
request; the agent wrote the code, the tests and the documentation, and ran
the checks. This post covers what came out of it, how the libraries are
built, where they stand on security and engineering practice next to their
peers, and what I learned about getting useful code out of an agent.&lt;/p&gt;
&lt;p&gt;The short version:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;pysqlx&lt;/strong&gt; went from version 1.0.2 to 3.0.0: four databases instead of
one, every value passed to the database as a parameter, a security
audit with three fixes, strict typing and about 140 tests that also run
against real PostgreSQL, MySQL and SQL Server servers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;samplepaths&lt;/strong&gt; went from its first release, 0.1.0, to 0.6.0: 68
processes, one interface for all of them, 3,182 tests, and Monte Carlo
batches that keep pace with a Rust implementation while staying pure
Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;pysqlx-sql-databases-without-writing-sql&#34;&gt;pysqlx: SQL databases without writing SQL&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/pysqlx/pysqlx&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;pysqlx&lt;/a&gt; describes tables, conditions and
queries as Python objects, and a client turns them into the SQL of the
database it is connected to:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;pysqlx&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ClientFactory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Table&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;client&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ClientFactory&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;get_sqlite_client&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;# a database in memory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;table_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;orders&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;customer&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append_char_string_column&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;column_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;customer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;total&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append_float_column&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;column_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;total&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;create&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;execute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;insert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;execute_many&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameters_list&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Ada&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;120.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Grace&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;80.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;rows&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orders&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;condition&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;total&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;execute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;# ((&amp;#39;Ada&amp;#39;, 120.0),)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;how-it-is-built&#34;&gt;How it is built&lt;/h3&gt;
&lt;p&gt;The package has four layers, each in its own subpackage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Structures&lt;/strong&gt; (&lt;code&gt;pysqlx.structures&lt;/code&gt;): databases, schemas, tables,
columns of nine types, indexes, foreign keys and joins. Comparing a
column with a value gives a condition, and conditions combine with &lt;code&gt;&amp;amp;&lt;/code&gt;,
&lt;code&gt;|&lt;/code&gt; and &lt;code&gt;~&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Queries&lt;/strong&gt; (&lt;code&gt;pysqlx.queries&lt;/code&gt;): one class per statement, from &lt;code&gt;Create&lt;/code&gt;
and &lt;code&gt;Select&lt;/code&gt; to &lt;code&gt;Union&lt;/code&gt; and &lt;code&gt;Reflect&lt;/code&gt;, which reads an existing table
back from the database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dialects&lt;/strong&gt; (&lt;code&gt;pysqlx.dialects&lt;/code&gt;): turn a query into SQL. The base class
implements what the databases have in common, so each dialect only
states its differences.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clients&lt;/strong&gt; (&lt;code&gt;pysqlx.clients&lt;/code&gt;): connect, run queries in transactions
and return typed results. &lt;code&gt;ClientFactory&lt;/code&gt; creates one for SQLite,
PostgreSQL, MySQL or SQL Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The package has no required dependency. The driver of each database server,
&lt;code&gt;psycopg&lt;/code&gt;, &lt;code&gt;pymysql&lt;/code&gt; or &lt;code&gt;pyodbc&lt;/code&gt;, is an optional extra, so SQLite users
install nothing else.&lt;/p&gt;
&lt;h3 id=&#34;what-the-work-changed&#34;&gt;What the work changed&lt;/h3&gt;
&lt;p&gt;The 2022 version wrote the values of conditions straight into the SQL text.
A name with a quote in it broke the statement, and a value typed by someone
else could change what the statement did: a textbook SQL injection, in my
own code. Version 2.0.0 passes every value to the database as a parameter,
quotes every name, and keeps &lt;code&gt;get_query_string()&lt;/code&gt; only as an escaped,
human-readable view of a query.&lt;/p&gt;
&lt;p&gt;Around that fix, the package gained PostgreSQL, MySQL and MariaDB next to
SQLite and SQL Server, transactions, joins, aggregates with &lt;code&gt;group_by&lt;/code&gt; and
&lt;code&gt;having&lt;/code&gt;, foreign keys, indexes and table reflection. Version 3.0.0 renamed
the parts of the interface whose names did not say what they do, with a
table in the changelog that maps every old name to the new one.&lt;/p&gt;
&lt;h2 id=&#34;samplepaths-realizations-of-stochastic-processes&#34;&gt;samplepaths: realizations of stochastic processes&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/samplepaths/samplepaths&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;samplepaths&lt;/a&gt; generates sample
paths of stochastic processes as NumPy arrays: Brownian motions and their
relatives, diffusions such as Cox-Ingersoll-Ross and Vasicek, jump
processes, fractional processes, ARIMA and GARCH time series, multi-factor
models such as Heston, Bates and SABR, and colored noise.&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 321; 
			flex-basis: 771px&#34;
	&gt;
	&lt;a href=&#34;https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/samplepaths-banner.png&#34; data-size=&#34;1440x448&#34;&gt;&lt;img src=&#34;https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/samplepaths-banner_hu_289292a49dffe2be.png&#34;
			width=&#34;1440&#34;
			height=&#34;448&#34;
			srcset=&#34;https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/samplepaths-banner_hu_131c7f87d1195f5.png 480w, https://www.girgis.me/p/two-python-libraries-rebuilt-with-a-coding-agent/samplepaths-banner_hu_289292a49dffe2be.png 1024w&#34; sizes=&#34;(min-width: 760px) 720px, 100vw&#34;
			fetchpriority=&#34;high&#34;
			alt=&#34;Realizations of a Brownian motion with drift, with their quantile bands&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;Realizations of a Brownian motion with drift, with their quantile bands&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;samplepaths&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GeometricBrownianMotion&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;gbm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GeometricBrownianMotion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;drift&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.05&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;volatility&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;prices&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gbm&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sample_paths_with_initial&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;64&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;paths&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;100_000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;initial&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;100.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;how-it-is-built-1&#34;&gt;How it is built&lt;/h3&gt;
&lt;p&gt;Every process is a class in one of six family subpackages: &lt;code&gt;continuous&lt;/code&gt;,
&lt;code&gt;diffusion&lt;/code&gt;, &lt;code&gt;discrete&lt;/code&gt;, &lt;code&gt;timeseries&lt;/code&gt;, &lt;code&gt;multivariate&lt;/code&gt; and &lt;code&gt;noise&lt;/code&gt;. They
derive from two base classes, &lt;code&gt;BaseTimeProcess&lt;/code&gt; for processes on a time
interval and &lt;code&gt;BaseSequenceProcess&lt;/code&gt; for those that evolve in steps, and
share one interface: &lt;code&gt;sample(n)&lt;/code&gt; for one realization and &lt;code&gt;sample_paths(n, paths)&lt;/code&gt; for many. Anything beyond that has its own named method, such as
&lt;code&gt;sample_exact()&lt;/code&gt; or &lt;code&gt;sample_hosking()&lt;/code&gt;, so simulation code can accept any
process without knowing which one it is.&lt;/p&gt;
&lt;p&gt;The rules of the code base are written down and enforced: one class per
file, files under 300 lines, keyword-only constructors, parameters
validated in property setters, and a docstring on everything public. The
library depends on NumPy and SciPy only.&lt;/p&gt;
&lt;h3 id=&#34;what-the-work-changed-1&#34;&gt;What the work changed&lt;/h3&gt;
&lt;p&gt;The mathematics of &lt;code&gt;stochastic&lt;/code&gt; was kept; everything around it was rebuilt.
The Python loops were replaced with NumPy operations, &lt;code&gt;sample_paths()&lt;/code&gt;
generates whole batches at once on several threads, and new families of
processes were added, to 68 in all. Compared with the first release of the
fork, a Markov chain of 4,096 steps takes 0.21 ms instead of 15 ms, and
100,000 Brownian paths of 64 steps take 6 ms on 14 cores.&lt;/p&gt;
&lt;p&gt;Two promises hold it together:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Results for a seed never change.&lt;/strong&gt; &lt;code&gt;sample()&lt;/code&gt; returns the same
values, bit for bit, for the same seed from one version to the next. A
check in CI compares 490 seeded results with the last release on every
pull request. A faster or better algorithm goes into a new method
instead of changing an old one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Results are checked against an independent implementation.&lt;/strong&gt; For
every process it shares with &lt;code&gt;stochastic-rs&lt;/code&gt;, a package with a Rust
core, samplepaths compares the distribution of 40,000 realizations with
a Kolmogorov-Smirnov test, 43 comparisons in all. The first run found
two processes that were wrong, both inherited from &lt;code&gt;stochastic&lt;/code&gt;: the
variance gamma process had a spread that depended on the number of
steps, and the CEV process had the wrong drift. Both are fixed and
documented.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;security&#34;&gt;Security&lt;/h2&gt;
&lt;p&gt;Neither library has been audited by an independent firm. What each has is
listed below, so the claim can be checked rather than taken on trust.&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Area&lt;/th&gt;
					&lt;th&gt;pysqlx&lt;/th&gt;
					&lt;th&gt;samplepaths&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;What could go wrong&lt;/td&gt;
					&lt;td&gt;SQL injection, leaked credentials, unencrypted connections&lt;/td&gt;
					&lt;td&gt;little: it reads and writes no files and opens no connections&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Review&lt;/td&gt;
					&lt;td&gt;an audit of the code in November 2026, with bandit, pip-audit and CodeQL, by the agent, reviewed by me&lt;/td&gt;
					&lt;td&gt;no dedicated audit; CodeQL&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Fixes from it&lt;/td&gt;
					&lt;td&gt;three, released in 2.1.0&lt;/td&gt;
					&lt;td&gt;none&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Code scanning&lt;/td&gt;
					&lt;td&gt;CodeQL on Python and workflows, on every pull request and daily; no open alerts&lt;/td&gt;
					&lt;td&gt;the same; two open alerts that two workflows do not declare their token permissions&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Vulnerability reporting&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;SECURITY.md&lt;/code&gt; with private reporting&lt;/td&gt;
					&lt;td&gt;not yet&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Releases&lt;/td&gt;
					&lt;td&gt;PyPI trusted publishing, no stored tokens&lt;/td&gt;
					&lt;td&gt;the same&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Dependencies&lt;/td&gt;
					&lt;td&gt;none required; Dependabot&lt;/td&gt;
					&lt;td&gt;NumPy and SciPy; Dependabot&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The audit of pysqlx found three problems after the injection fix of 2.0.0:
values containing &lt;code&gt;;&lt;/code&gt; could add attributes to the SQL Server connection
string, a SQLite database name such as &lt;code&gt;&amp;quot;../other&amp;quot;&lt;/code&gt; could create a file
outside its directory, and the SQL Server client logged a connection string
that could hold secrets. Version 2.1.0 fixed all three and added a
&lt;a class=&#34;link&#34; href=&#34;https://pysqlx.readthedocs.io/en/latest/guide/security.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;security
page&lt;/a&gt; that
says what the library protects against and what remains the job of the
calling code, such as never building a column&amp;rsquo;s default value from user
input.&lt;/p&gt;
&lt;h2 id=&#34;practices-and-design-next-to-peer-packages&#34;&gt;Practices and design next to peer packages&lt;/h2&gt;
&lt;p&gt;Both projects follow the same engineering baseline:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uv&lt;/code&gt; and one &lt;code&gt;Makefile&lt;/code&gt;: &lt;code&gt;make check&lt;/code&gt; runs ruff, mypy in strict mode,
the tests and a documentation build with warnings as errors, and the CI
workflows call the same targets.&lt;/li&gt;
&lt;li&gt;Tests on Linux, macOS and Windows with Python 3.11 to 3.14, on every
pull request and daily; samplepaths also runs daily against the newest
release of every dependency.&lt;/li&gt;
&lt;li&gt;Every change through a pull request with a summary and a verification
section, merged by squashing; the version comes from the release tag.&lt;/li&gt;
&lt;li&gt;Documentation on Read the Docs with a guide, an API reference, a
changelog and, for samplepaths, a gallery with an example for every
process.&lt;/li&gt;
&lt;li&gt;A record of design decisions and a roadmap in the repository, so a
decision is not reopened without a new reason.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How that compares with the alternatives:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;pysqlx.&lt;/strong&gt; SQLAlchemy is the standard for database access in Python, with
an ORM, a SQL expression language, many dialects and nearly twenty years of
production use; if a project already uses it, it should keep it. PyPika
builds SQL text and leaves running it to you. records and dataset are thin
layers for running SQL or storing rows, and records was last released in
March 2024. pysqlx sits between them: a small object model for tables and
queries that also connects and executes, parameterized by construction,
typed, with no required dependency, and tested against real PostgreSQL,
MySQL and SQL Server servers on every pull request. It does not try to
match SQLAlchemy&amp;rsquo;s breadth.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;samplepaths.&lt;/strong&gt; Its closest peers are &lt;code&gt;stochastic&lt;/code&gt;, which it replaces;
&lt;code&gt;stochastic-rs&lt;/code&gt;, which has a Rust core and more models, plus option pricing
and calibration; &lt;code&gt;aleatory&lt;/code&gt;, which adds built-in plots; and solvers for
arbitrary stochastic differential equations such as diffrax and torchsde.
Against &lt;code&gt;stochastic-rs&lt;/code&gt; it takes 0.5 to 1.4 times as long for 16 of 19
processes on batches of 100,000 short paths, and is faster for 7 of them.
For a single realization, compiled code wins by a factor of 1 to 14. What
samplepaths offers in return is a pure Python wheel that installs anywhere
NumPy does, one readable module per process, and results that are
reproducible on one thread or many. The project&amp;rsquo;s &lt;a class=&#34;link&#34; href=&#34;https://samplepaths.readthedocs.io/en/latest/project/comparison.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;comparison
page&lt;/a&gt;
has the full tables.&lt;/p&gt;
&lt;h2 id=&#34;working-with-a-coding-agent&#34;&gt;Working with a coding agent&lt;/h2&gt;
&lt;p&gt;Across 33 pull requests, the two projects gained about 63,000 lines of
code, tests and documentation, and the agent wrote most of them. What made
the result trustworthy was not the model alone but the structure around it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The rules live in the repository.&lt;/strong&gt; Each project has its instructions
for coding agents in &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;, with a
&lt;code&gt;CLAUDE.md&lt;/code&gt; that points to it, a decisions page and a roadmap. The
agent reads them at the start of every task and updates them in the
same change as the work, so the next session, human or agent, starts
from the same knowledge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Done means &lt;code&gt;make check&lt;/code&gt; passes.&lt;/strong&gt; Lint, strict typing, tests and the
documentation build run before any pull request, and again in CI on
three operating systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claims are checked against something outside the code.&lt;/strong&gt;
Bit-identical seeded results catch an optimization that changes
numbers. The comparison with &lt;code&gt;stochastic-rs&lt;/code&gt; caught two inherited bugs
that the existing tests had accepted. Tests against real database
servers catch what a mock would miss.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Numbers are measured, not written.&lt;/strong&gt; Every timing in the
documentation comes from a benchmark script in the repository, with the
machine it ran on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The agent proposes, I decide.&lt;/strong&gt; It opens pull requests with a summary
and a verification section and never merges; I review, squash-merge and
cut the releases. The decisions with consequences for users, such as
renaming the interface in pysqlx 3.0.0 or keeping samplepaths free of
compiled code, were mine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The agent was best at the work that is easy to postpone: a docstring on
every public name, a test for every invalid parameter, a gallery example
for every process, a changelog entry that tells users exactly how to update
their code. It also found the SQL injection in my own 2022 code, which says
as much about the value of a second reader as about the agent.&lt;/p&gt;
&lt;p&gt;It needed the guard rails. Without the seeded-results check, a vectorized
loop that changes the last bits of a result looks like a pure speed-up;
without an outside reference, a wrong drift passes its own tests. The
lesson I take from these two projects is that an agent raises the ceiling
on what one engineer can maintain, as long as the project states what
correct means in a form a machine can check.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
