| CARVIEW |
Select Language
HTTP/2 200
date: Sat, 17 Jan 2026 15:09:32 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"eedea94f76972b9fe804e2769584e8a0"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=M0Ms7zGoyfGVohxJKK22OB5lHDbLgRuiuZymi2%2FzZ2RIqjVWYdGrfAjZnfzRxSoZNTOPIaFNwlKzxB%2FRGnRtbzbJSt6HYtYkGKcz43jJIrJ6V%2B%2BJRFOVo4bR1A8SvcWHU%2BjQ4GtnneFfP3d4n8W%2BapzY9ssK92NWkw%2FjM7SwtOlMot%2BbCO1T17ZOhnk%2FJQVG5kO6QAAVSroBXfYOgbfbex0zMx3keZj1Mp%2FLmKQRKiuSe88uwfnf7Z7ieSaBkKDEvxVjRuddgLXIkeHe%2Fjeoqw%3D%3D--4bUb9LaMPzOiHzok--JoCPCVRKZ5%2FzOoL4hFxUfA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1505859049.1768662572; Path=/; Domain=github.com; Expires=Sun, 17 Jan 2027 15:09:32 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 17 Jan 2027 15:09:32 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: BAA0:30BEB2:14F5B4E:1885A3E:696BA62C
GitHub - dwincort/AdaptiveFuzz: Adaptive Fuzz Language
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 2
Adaptive Fuzz Language
License
dwincort/AdaptiveFuzz
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Adaptive Fuzz structure and general module hierarchy
---------------------------------------
When exploring Adaptive Fuzz, a good place to begin is with the Types module. Granted, it depends on Support.FileInfo, but
this is a small, straightforward module that deals with file information. For the purposes of Types, it simply
provides a type to represent where a piece of abstract syntax came from in a file.
The Types module declares all of the most important base types for Adaptive Fuzz, notably including the sensitivity type
(si), the type for types (ty), and the type for terms (term).
\paragraph{Main Structure}
After understanding the types, one can follow the path from source file to interpreted result by following the
chain of modules: parser -> tycheck -> interpreter -> prim.
\begin{itemize}
\item The parser technically depends on the lexer, but the lexer is hardly necessary to understand the conversion
from source to syntax tree.
\item The type checker has a number of submodules:
\begin{itemize}
\item TypeCheckMonad contains the functions for the checker monad.
\item TypeSens deals with sensitivities in the type.
\item TypeInf deals with the small amount of type inference that is performed.
\item TypeSub deals with type polymorphism and checking if types are equal to/are subtypes of other types.
\end{itemize}
After that, the core type checking is done with the type_of function. Because this function is in the
checker monad, there is also a front-facing function get_type that will convert the monadic failure to
an ocaml error.
Note that type checking can proceed \emph{with} sensitivity checking turned on or \emph{without}.
\item The interpreter has one submodule, InterpMonad, that contains functions for the interp monad. Beyond
that, there is the interp function for interpreting functions and the run_interp function which is the
non-monadic version of this. Note that the interp monad can internally switch between partial and
full evaluation, and also, the interp monad can call out to the type checker (with
InterpMonad.checkerToInterpreter).
\item The Prim module contains definitions for Fuzz's primitive functions. It begins with a bunch of helper
functions for creating primfuns, then there are a bunch of specific implementations for primitive functions,
and finally, there is the mapping that associates the names of the primitive functions (as strings) to
their definitions (as primfuns).
\end{itemize}
\paragraph{Partial Evaluation}
Note that there is a mutual dependence between then type checker and the interpreter, which is encoded by
requiring that a "pinterp" function be provided to the type checker when it is created (thus, really, the
type checker depends on the interpreter and not the other way around). This is because the type checker
can perform \emph{partial evaluation} on a term in order to try and find a type for it. This is primarily
used to evaluate expressions in sensitivities, but it can also be used to unroll loops and otherwise simplify
the job of the type checker. In essence, type checking proceeds as follows:
First, type checking proceeds regularly.
If type checking fails, the "pinfo" component of the type checking monad is examined.
If it is Some value, then the term is partially evaluated. If partial evaluation succeeds,
type checking is tried again. Otherwise, or if type checking fails again, the original error
is thrown.
Partial evaluation is not exactly the same as regular evaluation (see the pinterp function in Interpreter).
Critically, it evaluates the expressions found in sensitivities in functions (and primitive function arguments).
\paragraph{Compilation}
In addition to the path from source file to interpreted result, there is a path from interpreted
runFuzz command to compiled red zone execution that goes from prim -> codegen -> primml.
\begin{itemize}
\item The Prim module can run everything, but Adaptive Fuzz is designed so that the database-sensitive
Fuzz queries can be compiled and run on a separate process (turning the compiler on and off
is done by command line argument---it defaults to on). The call to this can be found in
Prim.runRedZone.
\item The Codegen module is essentially a pretty printer that turns a Fuzz syntax tree into OCaml code
that can then be compiled by the OCaml compiler. The function runCompiled also handles compilation,
running the compiled program, some inter-process communication, and error handling.
\item The Primml module is the main support library for any compiled chunk of Adaptive Fuzz. It contains
most of the definitions of the primitive functions (some functions are not supported in compiled code),
but as pure OCaml code (rather than as functions over syntax trees like in the Prim module).
\end{itemize}
Communication from the compiled curator process to the interpreted analyst code is handled by marshaling.
\paragraph{The Rest}
Next, there is the main module that controls Fuzz: the Fuzz module itself. This ties together uses
of the lexer/parser, type checking, and interpreter, but it has very little logic of its own.
The rest of the modules offer one variety or another of support.
\begin{itemize}
\item Syntax has support for mapping and equality over syntax trees.
\item Ctx support the variable context that is used during type checking.
\item Support has three submodules for file info, runtime errors, and command line options for Fuzz.
\item Math contains the pure math for Fuzz's differential privacy mechanisms.
\item Print contains pretty printing functions for all of the special types in Fuzz.
\item Option has a few useful functions for working with ocaml's Option type.
\item Util contains a couple of utility functions not directly related to Fuzz.
\item ComposeDP defines the privacy filters than Adaptive Fuzz uses.
\item Lexer is the lexer.
\end{itemize}
About
Adaptive Fuzz Language
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
You can’t perform that action at this time.