Skip to content

Rule out walked series with no instance in the window #40

Open

Description

@PhilflowIO

Symptom

After #37 (PR #39), birthdays and other fixed-day yearly rules cost nothing outside the window, but every other open-ended rule still walks about three candidates (90-135 units) per call, even when it has no instance in the window. Example: 5,000 series FREQ=YEARLY;BYMONTH=6;BYDAY=1SU from 1960 queried for one week of 2026 cost 675,000 units, more than twice a 300,000-unit budget, so consumers report "incomplete" on a correct calendar.

Idea

Rule out a series before any walk when its rule provably has no instance in the window, e.g. YEARLY/MONTHLY with BYMONTH not covering the window's months, WEEKLY with BYDAY not hit by the window's weekdays. Must be exact (property test against the full walk), and fall back to walking when not provable.

Acceptance

  • 5,000 such series for a window they don't touch cost a small constant per series (no ical.js walk).
  • Property test: exclusion never drops a series that has an instance in the window.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions