MatLogica AADC: AAD, Greeks and the AADC Tracer

com.matlogica由 matlogica.com 发布v0.2.1更新于 Nov 6, 2026

AAD from your coding agent: exact Greeks with MatLogica AADC, and a price traced to its source line

概览

AI 生成的概览

在本机运行 MatLogica AADC 自动伴随微分:追踪 Python 定价脚本、计算精确 Greeks,并在新输入下重放 tape。

可以做什么
  • 检查本机 AADC 引擎、许可证版本与自检结果
  • 开启追踪运行 Python 脚本并保留 tape,或加载、列出已有 tape
  • 用引擎自带语法查询 tape:统计、叶子、分支、站点、源码行、查找、来源、使用、锥
  • 在新输入值下重放 tape,并说明记录的路径是否仍然成立
  • 开启实时录制会话,用同样语法提问、精确重放并关闭会话
  • 列出、读取并运行内置示例,包括未经修改的 QuantLib 定价器
适用场景
适合在助手协助 AADC 相关工作时使用:为 Python 定价器求精确导数与 Greeks、处理在分支或拐点处跳变的导数,或把算出的价格追溯到产生它的源码行。
运行要求
以本地 stdio 进程运行,从 PyPI 包 aadc-mcp 安装,仅限桌面端。需要装有 AADC 引擎的 Python 解释器;QuantLib 示例还需 aadc-quantlib-tracing,且限 Linux x86-64 或 macOS arm64。未声明认证、环境变量或请求头。
安装前请注意
trace_script 与 run_example 会在用户本机以开启追踪的方式执行 Python 代码,服务器明确说明这不是沙箱。tape 与会话保存在服务器的工作目录中。survives=false 的重放不携带数值,不应估算。一个 tape 只代表某一输入点的一次执行,不代表所有可能路径。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MatLogica AADC: AAD, Greeks and the AADC Tracer,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

工具

15

check_environment

What this interpreter can do with AADC and the Tracer, measured: installed packages and versions, platform, licence (one sentence naming the edition the engine runs as and what it permits; tell the user), an engine self-test (record, replay, reverse: dz/dx = 6 at x = 3), a tracing self-test (one traced QuantLib call must attribute leaves to QuantLib's C++), and findings with the pip command that fixes each. Call it first; call it again after installing anything.

无需输入参数。

trace_script

Run a Python script with tracing on and keep the record (tape) it leaves. The script needs no changes: it runs in its own directory with AADC_TRACE=1, so every calculation through aadc types or an AADC-built library such as aadc-quantlib-tracing is recorded with its source coordinates. Returns tape_id, the script's stdout and stderr, the engine's census (frozen branch sites, outputs) and stats. A script that records itself and ends with f.save_tape() writes to AADC_TRACE_OUT; mark its first line with 'mode=explicit'. outputs: optional AADC_TRACE_OUTPUTS entries, e.g. ['value=123.45'] or ['pricer.py:42'], to name the program's results on the tape. python: another interpreter to run under (the one where the user's packages live). This runs the user's own code on the user's own machine; it is not a sandbox.

输入参数argspath必填pythonoutputsworkdirtimeout_s

inspect_tape

Ask the tape one question in the engine's own grammar and get its text answer plus the parsed header. Verbs: 'stats' | 'leaves [kind=input|constant] [by=leaf] [limit=N]' | 'branches order=margin [limit=N]' | 'sites [file=NAME] [limit=N]' | 'at FILE:LINE [context=N]' (source with the recorded values; hash=ok means the file shown is the one compiled) | 'find value=X' (where a printed number was computed) | 'origin #N' (the formula behind a value) | 'uses #N' | 'cone #N' (which leaves can move a value, by derivative or only by a branch) | 'source root=COMPILED=LOCAL' (map compiled paths to a local source tree) | 'replay ...' (prefer the replay tool). Ids are #N from earlier answers. A malformed request answers status=error in the header, never an exception.

输入参数request必填tape_id必填max_lines

replay

Re-evaluate the tape at new inputs without re-running the model. assignments: '#12=101' or '#12=101,#15=0.21' (leaf ids from 'leaves kind=input' or 'leaves by=leaf'); out: the output id from 'find value=<printed price>'. survives=true: the recorded path holds and value is exact (equal to a fresh run to the last digit). survives=false: WITHHELD; flipped names the decision (file:line, decided true -> false) and unchecked the conversions the tape cannot check. There is no value to quote in that case. A tape read back from a file keeps no operand for a counted conversion, so on most QuantLib tapes a replay is withheld with unchecked naming the line (often errorfunction.cpp:200); say so and re-run the script at the new inputs for the price. path_recorded=true returns the recorded path's value labelled as such, for comparison only.

输入参数out必填tape_id必填assignments必填path_recorded

set_source_root

Map the compiled source prefix recorded on the tape (for aadc-quantlib-tracing 1.41 it is /project/work/QLAADC/ql) to a local directory holding that source, so 'at FILE:LINE' and 'origin' can show the code. Later answers say hash=ok when the local file is the one the library was compiled from and hash=MISMATCH when it is not; a mismatch is reported, never silent. Remembered for this tape.

输入参数tape_id必填local_dir必填compiled_prefix必填

load_tape

Register an existing .tape file written earlier (by trace_script, by a script's own save_tape(), or downloaded from a report) and return its tape_id and stats.

输入参数path必填

list_tapes

The tapes this server holds: id, file, size, the script that produced each, and the source roots applied.

无需输入参数。

open_session

Run a Python script that records itself (aadc.Functions, start_recording with marked inputs, stop_recording) and keep its process alive, so later questions are answered by the object that recorded. Returns session_id, the script's stdout, which Functions object was kept, and its stats. Why: a record read back from a file cannot re-check a counted conversion, so 'replay' on it is often withheld; in the recording process the same replay is exact (the same digits as pricing again). Use it for what-ifs and sensitivities on a script with marked inputs; for an unmodified script use trace_script. The script's save_tape() to AADC_TRACE_OUT also registers a tape. Idle sessions close themselves after AADC_MCP_SESSION_IDLE_S seconds (default 1800). This runs the user's own code on the user's own machine.

输入参数argspath必填pythontimeout_s

ask_session

The same question grammar as inspect_tape (stats, leaves, branches, sites, at, find, origin, uses, cone, source), answered by the live recording of an open_session.

输入参数request必填max_linessession_id必填

replay_session

Replay the live recording at new inputs. assignments: '#0=101' (leaf ids from ask_session 'leaves kind=input by=leaf'); out: the id marked OUTPUT from 'find value=<printed price>'. survives=true means the recorded path holds and value is exact to the last digit; survives=false is WITHHELD with the decision named (flipped) and no value.

输入参数out必填session_id必填assignments必填path_recorded

close_session

End a live session and free its process.

输入参数session_id必填

list_sessions

The live sessions this server holds: id, script, start time, questions answered.

无需输入参数。

list_examples

Bundled scripts to start from: plain AADC (any platform), and unmodified QuantLib pricers that aadc-quantlib-tracing records (Linux x86-64, macOS arm64). mode=auto scripts are traced as they are; mode=explicit scripts record themselves and print sensitivities. Each is a starting point to copy and edit.

无需输入参数。

get_example

The source of one bundled example, to read, copy or adapt.

输入参数name必填

run_example

Copy one bundled example into the server's working folder, run it with tracing on and return its tape_id, its printed output and the tape's stats. Then question the tape with inspect_tape and replay.

输入参数name必填timeout_s

版本历史

2
  1. v0.2.1最新Nov 5, 2026
  2. v0.2.0Nov 5, 2026

评分

已满足适用检查项的 55%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分

    请在注册中心条目中发布图标。

  • 文档15 分

    请声明包含 README 的 GitHub 仓库,或在 OAuth 受保护资源元数据中提供 resource_documentation。

  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。