Skip to content

Is OpHistory preserving what we want? #100

Closed

Description

@hinerm

While running a Map operation (coarseness), I noticed that the OpHistory was full of keys for all the individual pixels of the operation.

However because UnsignedByteType has a hashCode and equals that is defined by the byte value, the mutationMap is going to look more like a histogram of values, with the resulting pixels getting a number of entries equal to their frequency.

But that doesn't really tell us anything about the order things were done right? And I'm not sure what "history" really means if an op is multithreaded across each pixel in an image.

Also of note was that the map "output" pixels is an anonymous object created as part of a lambda, so it would be reasonable to expect these keys to be GC'd out of the WeakHashMap at any point.. which maybe makes this a moot issue?

So I guess the questions are:

  • Do we actually care about preserving the per-pixel history of an operation like Map?
  • If so, is that what we're actually doing now?
  • If not, should Map actually both recording history?

image

Activity

  1. gselzer commented on Jul 12, 2023

    @gselzer
    Member

    It looks like a lot of this was solved via scijava/incubator#64, right @hinerm? Is there anything left to do here? E.g. how should simplification/adaptation be handled?

  2. gselzer commented on Sep 5, 2023

    @gselzer
    Member

    @hinerm I'm sorry I never answered your questions:

    Do we actually care about preserving the per-pixel history of an operation like Map?

    I'm not sure that I really care - what I care about is that the return from history.executionsUpon(output) returns only the parent Op (i.e. not the dependencies). I feel like, in the case of Map, if history.executionsUpon(output.firstElement()) returns the dependency, that would be optimal. The histogram-like effect you're seeing in that image, though, means we can't obtain that behavior, which is unfortunate.

    If so, is that what we're actually doing now?

    Right now, we only record the history of Ops that are returned by an ops.op call (or the OpBuilder syntax, which calls that), so internal Op calls (dependencies, simplification, adaptation) shouldn't call that. Do you remember how you produced the mutationMap above?

    If not, should Map actually both recording history?

    What Map are we talking about? If it is the map.neighborhood Ops you altered in scijava/incubator#64, I'm hoping to get rid of those with scijava/incubator#33.

  3. added a commit that references this issue on May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions