Skip to content

Validity prototype#2470

Open
MaxAtoms wants to merge 30 commits into
staging/validity-lintingfrom
validity-prototype
Open

Validity prototype#2470
MaxAtoms wants to merge 30 commits into
staging/validity-lintingfrom
validity-prototype

Conversation

@MaxAtoms
Copy link
Copy Markdown
Collaborator

@MaxAtoms MaxAtoms commented May 5, 2026

I allowed myself to just experiment for a bit. It's a very crude untested prototype right now.
Demo available via npm run taint-test.

@MaxAtoms MaxAtoms requested a review from EagleoutIce May 5, 2026 09:03
@MaxAtoms MaxAtoms self-assigned this May 5, 2026
Comment thread src/taint-analysis/scale-domain.ts Outdated
type Lift = typeof Scaled | typeof Unscaled | typeof Top | typeof Bottom;

// TODO Builder pattern in the DSL for the definition of finite taint lattices
export class ScaleDomain<Value extends Lift = Lift> extends AbstractDomain<Lift, Lift, typeof Top, typeof Bottom, Value> {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the AbstractInterpretationVisitor has been fine so far. My biggest gripe is the need to define the type of concrete values and abstraction/concretization functions


export const predefinedTaintAnalyses = {
'scale': scaleAnalysis,
} as const satisfies AnalysisMap<['scale']>;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I actually make this type safe so that the key name has to be the same literal string as the Name of the respective TaintAnalysisDefinition<Name>?

@MaxAtoms
Copy link
Copy Markdown
Collaborator Author

Plz roast when you find the time, @EagleoutIce 😇

} as const satisfies AnalysisMap<['scale']>;

type AnalysisMap<Defs extends readonly string[]> = {
[key in TaintAnalysisName<TaintAnalysisDefinition<Defs[number]>>]: TaintAnalysisDefinition<Defs[number]>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can make it type safe here, if you reuse key on the rhs?

@MaxAtoms MaxAtoms marked this pull request as ready for review May 27, 2026 13:56
@MaxAtoms MaxAtoms requested a review from EagleoutIce May 27, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants