Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e939458
wip(rda-plugin): draft implementation of RDA file parser
stimjannik Apr 23, 2026
9563935
wip(rda-plugin): draft of RDA parser tests and random code generator
stimjannik Apr 23, 2026
7fcfbe1
wip(rda-plugin): add real-world tests, start documentation
stimjannik Apr 30, 2026
6ac49a2
wip(rda-plugin): first working version, restructuring, use zenodo files
stimjannik May 7, 2026
7c4f7fd
feat(rda-plugin): add load parsing to dataflow
stimjannik May 19, 2026
ff1c2fd
doc(rda-plugin): add documentation
stimjannik May 21, 2026
7c16c28
feat(rda-plugin): change vertices to function definitions
stimjannik May 21, 2026
2a63567
test(rda-plugin): add first dataflow load test
stimjannik May 21, 2026
a0f18b4
feat-fix(rda-plugin): fix calls and reads edges
stimjannik Jun 4, 2026
32f0ada
test(rda-plugin): add overwrite tests, adapt tests to new edges
stimjannik Jun 4, 2026
15774a8
lint-fix(rda-plugin): exclude bzip2 from license check
stimjannik Jun 4, 2026
cd113e3
lint-fix(rda-plugin): fix linting issues
stimjannik Jun 4, 2026
3bfa684
feat-fix(rda-plugin): handle side effects
stimjannik Jun 4, 2026
31777fd
test(rda-plugin): make tests dependent on zenodo csv
stimjannik Jun 11, 2026
9ffdc9b
test(rda-plugin): skip tests if test files are missing
stimjannik Jun 11, 2026
3fbba81
lint-fix(rda-plugin): fix braces
stimjannik Jun 11, 2026
b1140be
doc-fix(rda-plugin): add ignoreLoadCalls to wiki page
stimjannik Jun 11, 2026
b1b06f5
tests(rda-plugin): add random rda tests to dataflow-load.test.ts
stimjannik Jun 12, 2026
8a25d6f
test-fix(rda-plugin): fix deletion of tmp folder
stimjannik Jun 12, 2026
2b8a92b
refactor(rda-plugin): clean up RDAParser and built-in-load
stimjannik Jun 18, 2026
c43fe50
refactor(rda-plugin): clean up built-in-load
stimjannik Jun 18, 2026
b0435f6
Merge remote-tracking branch 'origin/main' into 2096-rda-plugin
stimjannik Jun 24, 2026
65f0cd0
feat-fix(rda-plugin): complete load() integration after merge
stimjannik Jun 24, 2026
8a6b80f
feat-fix(rda-plugin): mark unresolvable file as unknown effect
stimjannik Jun 25, 2026
a40daee
feat(rda-plugin): include environment
stimjannik Jun 25, 2026
f08094f
doc(random-r-code-generator): document random R code generator
stimjannik Jun 29, 2026
69da2aa
Merge remote-tracking branch 'origin/main' into 2096-rda-plugin
stimjannik Jun 29, 2026
89e6fcf
feat-fix(rda-plugin): add load to built-in, fix tests
stimjannik Jun 29, 2026
243a706
fix(random-r-code-generator): correct weighted random index selection
stimjannik Jul 13, 2026
2ee69c4
fix(random-r-code-generator): use valid R expression in generatePromise
stimjannik Jul 13, 2026
06ace52
fix(random-r-code-generator): generate rows*cols elements for matrix…
stimjannik Jul 13, 2026
f6a5bdc
fix(random-r-code-generator): use path.join for temp dir
stimjannik Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build:copy-wasm": "mkdir -p dist/node_modules/@eagleoutice/tree-sitter-r/ && mkdir -p dist/node_modules/web-tree-sitter && cp node_modules/@eagleoutice/tree-sitter-r/tree-sitter-r.wasm dist/node_modules/@eagleoutice/tree-sitter-r/ && cp node_modules/web-tree-sitter/tree-sitter.wasm dist/node_modules/web-tree-sitter/",
"lint-local": "npx eslint --version && npx eslint src/ test/ --rule \"no-warning-comments: off\"",
"lint": "npm run license-compat -- --summary && npx eslint --version && npx eslint src/ test/",
"license-compat": "license-checker-rseidelsohn --onlyAllow 'MIT;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD'",
"license-compat": "license-checker-rseidelsohn --onlyAllow 'MIT;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD' --excludePackages 'bzip2'",
Comment thread
stimjannik marked this conversation as resolved.
Outdated
"doc": "typedoc",
"test": "vitest --exclude \"test/system-tests/**\" --config test/vitest.config.mts",
"test:system": "vitest --dir test/system-tests --config test/system-tests/vitest.config.mts",
Expand Down Expand Up @@ -174,6 +174,7 @@
"@types/command-line-usage": "^5.0.4",
"@types/commonmark": "^0.27.10",
"@types/dagre": "^0.7.53",
"@types/lzma-native": "^4.0.4",
"@types/n-readlines": "^1.0.6",
"@types/n3": "^1.26.0",
"@types/object-hash": "^3.0.6",
Expand All @@ -200,6 +201,7 @@
"@eagleoutice/tree-sitter-r": "^1.1.2",
"@jupyterlab/nbformat": "^4.5.0",
"@xmldom/xmldom": "^0.9.7",
"bzip2": "^0.1.1",
"clipboardy": "^4.0.0",
"command-line-args": "^6.0.1",
"command-line-usage": "^7.0.3",
Expand All @@ -208,6 +210,8 @@
"gray-matter": "^4.0.3",
"joi": "^18.0.1",
"lz-string": "^1.5.0",
"lzma-native": "^8.0.6",
"lzma1": "^0.3.0",
Comment thread
stimjannik marked this conversation as resolved.
"n-readlines": "^1.0.1",
"n3": "^1.23.1",
"object-hash": "^3.0.0",
Expand All @@ -222,5 +226,9 @@
"web-tree-sitter": "^0.24.7",
"ws": "^8.18.0",
"xpath-ts2": "^1.4.2"
},
"main": "vitest.config.js",
"directories": {
"test": "test"
Comment thread
stimjannik marked this conversation as resolved.
Outdated
}
}
22 changes: 14 additions & 8 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export interface FlowrConfigOptions extends MergeableRecord {
* Whether source calls should be ignored, causing {@link processSourceCall}'s behavior to be skipped
*/
readonly ignoreSourceCalls: boolean
/**
* Whether load calls should be ignored, causing {@link processLoadCall}'s behavior to be skipped
*/
readonly ignoreLoadCalls: boolean
/** Configure language semantics and how flowR handles them */
readonly semantics: {
/** Semantics regarding the handling of the environment */
Expand All @@ -110,13 +114,13 @@ export interface FlowrConfigOptions extends MergeableRecord {
}
}
}
/** Configuration options for the REPL */
readonly repl: {
/** Whether to show quick stats in the REPL after each evaluation */
quickStats: boolean
/** This instruments the dataflow processors to count how often each processor is called */
dfProcessorHeat: boolean;
}
/** Configuration options for the REPL */
readonly repl: {
/** Whether to show quick stats in the REPL after each evaluation */
quickStats: boolean
/** This instruments the dataflow processors to count how often each processor is called */
dfProcessorHeat: boolean;
}
readonly project: {
/** Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files */
resolveUnknownPathsOnDisk: boolean
Expand Down Expand Up @@ -243,6 +247,7 @@ const defaultEngineConfigs: { [T in EngineConfig['type']]: EngineConfig & { type

export const defaultConfigOptions: FlowrConfigOptions = {
ignoreSourceCalls: false,
ignoreLoadCalls: false,
semantics: {
environment: {
overwriteBuiltIns: {
Expand Down Expand Up @@ -292,6 +297,7 @@ export const defaultConfigOptions: FlowrConfigOptions = {

export const flowrConfigFileSchema = Joi.object({
ignoreSourceCalls: Joi.boolean().optional().description('Whether source calls should be ignored, causing {@link processSourceCall}\'s behavior to be skipped.'),
ignoreLoadCalls: Joi.boolean().optional().description('Whether load calls should be ignored, causing {@link processLoadCall}\'s behavior to be skipped.'),
semantics: Joi.object({
environment: Joi.object({
overwriteBuiltIns: Joi.object({
Expand Down Expand Up @@ -462,4 +468,4 @@ function loadConfigFromFile(configFile: string | undefined, workingDirectory: st

log.info(`Using default config ${JSON.stringify(defaultConfigOptions)}`);
return defaultConfigOptions;
}
}
4 changes: 4 additions & 0 deletions src/control-flow/semantic-cfg-guided-visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ export class SemanticCfgGuidedVisitor<
case BuiltInProcName.Function:
case BuiltInProcName.FunctionDefinition:
return this.onDefaultFunctionCall({ call });
case BuiltInProcName.Load:
return this.onLoadCall({ call });
default:
assertUnreachable(origin);
}
Expand Down Expand Up @@ -687,4 +689,6 @@ export class SemanticCfgGuidedVisitor<
* @protected
*/
protected onReturnCall(_data: { call: DataflowGraphVertexFunctionCall }) {}

private onLoadCall(_param: { call: DataflowGraphVertexFunctionCall }) {}
}
6 changes: 5 additions & 1 deletion src/dataflow/environments/built-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { processTryCatch } from '../internal/process/functions/call/built-in/bui
import { processRegisterHook } from '../internal/process/functions/call/built-in/built-in-register-hook';
import { processLocal } from '../internal/process/functions/call/built-in/built-in-local';
import { processS3Dispatch } from '../internal/process/functions/call/built-in/built-in-s-three-dispatch';
import { processLoadCall } from '../internal/process/functions/call/built-in/built-in-load';

export type BuiltIn = `built-in:${string}`;

Expand Down Expand Up @@ -224,6 +225,8 @@ export enum BuiltInProcName {
Library = 'builtin:library',
/** for `list` calls, see {@link processList} */
List = 'builtin:list',
/** for 'load' calls see {@link processLoadCall} */
Load = 'builtin:load',
Comment thread
stimjannik marked this conversation as resolved.
Outdated
/** for `local` calls, see {@link processLocal} */
Local = 'builtin:local',
/** for the pipe operators, see {@link processPipe} */
Expand Down Expand Up @@ -277,6 +280,7 @@ export const BuiltInProcessorMapper = {
[BuiltInProcName.IfThenElse]: processIfThenElse,
[BuiltInProcName.Library]: processLibrary,
[BuiltInProcName.List]: processList,
[BuiltInProcName.Load]: processLoadCall,
[BuiltInProcName.Local]: processLocal,
[BuiltInProcName.Pipe]: processPipe,
[BuiltInProcName.Quote]: processQuote,
Expand Down Expand Up @@ -336,7 +340,7 @@ export class BuiltIns {
type: ReferenceType.BuiltInFunction,
definedAt: id,
cds: undefined,
/* eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-argument */
/* eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument */
processor: (name, args, rootId, data) => mappedProcessor(name, args, rootId, data, config as any),
config,
name,
Expand Down
3 changes: 2 additions & 1 deletion src/dataflow/environments/default-builtin-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export const DefaultBuiltinConfig = [
}
}, assumePrimitive: true },
{ type: 'function', names: ['('], processor: BuiltInProcName.Default, config: { returnsNthArgument: 0 }, assumePrimitive: true },
{ type: 'function', names: ['load', 'load_all', 'setwd', 'set.seed'], processor: BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: false },
{ type: 'function', names: ['load'], processor: BuiltInProcName.Load, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: false },
Comment thread
stimjannik marked this conversation as resolved.
Outdated
{ type: 'function', names: ['load_all', 'setwd', 'set.seed'], processor: BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: false },
{ type: 'function', names: ['body', 'formals', 'environment'], processor: BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: true },
{ type: 'function',
names: ['.Call', '.External', '.C', '.Fortran'],
Expand Down
2 changes: 2 additions & 0 deletions src/dataflow/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface ControlDependency {
readonly when?: boolean
/** whether this control dependency was created due to iteration (e.g., a loop) */
readonly byIteration?: boolean
/** the filepath that caused this dependency (e.g., for load() calls where the file must exist) */
readonly file?: string
Comment thread
stimjannik marked this conversation as resolved.
}

/**
Expand Down
Loading