Skip to content

Conversation

@cristianoc
Copy link
Contributor

No description provided.

Add DCE formalization and clarify reduce semantics

DCE formalization (main change):
- Add lean-formalisation/DCE.lean: complete Lean formalization of
  reactive Dead Code Elimination with graph fragments, reachability
  computation, and refcount maintenance (1346 lines)
- Add dce_reactive_view.tex: paper describing reactive DCE using
  reducers and mappers for aggregating distributed program graphs
- Update lean-formalisation/lakefile.toml to include DCE in
  defaultTargets and add DCE as a lean_lib entry
- Remove lean-formalisation/Reduce/Basic.lean (refactored to
  top-level Reduce.lean)

reduce.tex clarifications:
- Add "Asymmetric inverse law" remark after well-formedness definition,
  explaining why only $(a \oplus v) \ominus v = a$ is required (not the
  reverse), and how this ensures incremental updates work correctly
- Add "Why remove then add?" remark after delta application definition,
  explaining that the order mirrors incremental update semantics
- Add "Order matters when Δ⁺ and Δ⁻ overlap" example demonstrating
  that remove-then-add is essential when working with sets (add-then-remove
  fails when deltas overlap, incorrectly removing newly added elements)

Also regenerate reduce.pdf and add dce_reactive_view.pdf
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- REACTIVE_CALCULUS_NOTES.md: Add Skip reducer laws (commutativity, invertibility),
  document JSON key ordering, structural operators, per-key aggregation,
  lazy/compute nodes, and DCE case study (Section 9)

- bindings/SkipruntimeCore.res: Document JSON.t structure, Skip JSON ordering,
  and boolean serialization issue for slice/slices/take methods

- examples/JsonOrderingService.ts + JsonOrderingHarness.res: Comprehensive test
  for Skip JSON key ordering behavior (null < bools < numbers < strings < arrays < objects)
  and verification that boolean keys don't collide with numeric 0/1

- examples/BoolKVService.ts + BoolKVHarness.res: Minimal test for boolean
  key/value handling

- examples/LiveHarnessService.js: Refactor static fields for JS compatibility

- tsconfig.json: Simplify include pattern to examples/*.ts

- AGENTS.md: Add workspace rules for AI assistants
Comprehensive analysis of ~48 examples from the catalogue:
- Classify each by primitives needed (structural, standard/enriched reducer, partial, compute node)
- Identify that >50% use only standard reducers (count, sum)
- Discover simpler solutions for several 'complex' examples:
  - Top-K: structural via key ordering (no reducer)
  - Joins: map with context lookups
  - Resettable accumulator: epoch-based keys
  - Sliding windows: external eviction (Skip idiom)

Extended deep dives for 8 complex examples:
- Top-K, HLL, sliding window, undo/redo, resettable accumulator
- Acyclic joins, counting/DRed views, fixpoint algorithms

Propose calculus primitives in 5 tiers:
1. Structural (map, slice, take, merge)
2. Standard reducers (count, sum)
3. Combinators (product, mapInput, mapOutput)
4. Enriched patterns (average, freqMap, histogram)
5. Compute nodes (lazyCompute, fixpoint)

Reference DCE case study as concrete instantiation of the layered approach.
- Remove DBToaster subsection from Example 6.1
- Add as alternative approach under Example 6.3
- Adapt content to focus on join materialization (S ⋈ T)
- Add trade-off table comparing idiomatic vs DBToaster-style patterns
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.

2 participants