Skip to content

Replace Boost.MPL with Boost.MP11 in extension/dynamic_image/reduce.hpp #281

Closed

Description

@mloskot

Additional task related to #274 to either switch the extension/dynamic_image/reduce.hpp to Boost.MP11 and C++11 or to remove it completely.

Currently, it is compiled on demand if #define BOOST_GIL_REDUCE_CODE_BLOAT=1 and no Jamfile or CMakeLists.txt define it.

Possibly, it's never been used by anyone - any users of this feature, please, speak up now!

/cc @chhenning @stefanseefeld @lpranam

References

Activity

  1. self-assigned this
    on Apr 14, 2019
  2. lpranam commented on Mar 18, 2020

    @lpranam
    Member

    I would like to vote in favour of removing this header file first reason is as you mentioned it is compiled on demand and the second reason would it is actually not mentioned anywhere in the official GIL(at least I could not find it anywhere) documentation so there are fewer chances of people using it.

  3. mloskot commented on Mar 18, 2020

    @mloskot
    MemberAuthor

    TL;TR: Yes, I'm inclined to remove it. If anyone arrives asking for it, it can be recovered from the history, but given it is 1) unused, 2) seems unfinished and 3) purpose is unclear, I don't think we can promise any reliable support for it.

    /cc @stefanseefeld


    I have no idea what was the exact rationale and purpose of this code, but I can only deduce it was added to workaround some MPL limitations or issues:

    /// It is not a full-blown MPL Random Access Type sequence; just has at_c and size implemented

    /// Temporary solution because I couldn't get mpl::copy to do this.

    and then there are some algorithms to reduce elements of type lists (elements of any image/view variants)

    /// Temporary solution because I couldn't get mpl::copy to do this.

    based on reducibility and other properties of color bases of the views/images:

    //// Color space unary reduce operation. Reduce a color space to a base with the same number of channels

    The reduction seems like composing an image/view type common to all types of variant image/view (e.g. find image type that all the possible types can be converted into, and back to original type, without any losses, perhaps?)

    However, large chunks of the reduce.hpp are commented, so it feels like a work in progress.

  4. sdebionne commented on Mar 19, 2020

    @sdebionne
    Contributor

    For the records, this academic paper explains the how and the why of reduce.hpp. Personally, I have never used BOOST_GIL_REDUCE_CODE_BLOAT=1. Does it really reduce code bloat with modern compilers?

  5. mloskot commented on Mar 19, 2020

    @mloskot
    MemberAuthor

    @sdebionne What a finding, thank you! I archived the reference in d664a4a

    From MinimizingCodeBloat.pdf

    Our test bed, GIL, is deployed in a real world industrial setting (...)

    That could explain undocumented and untested or experimental status of the reduce.hpp :)

    3.2 Dynamic dispatching in GIL
    (...)
    3.3 Template bloat originating from GIL’s dynamic dispatching
    (...)
    4. Reducing the Number of Instantiations
    Our strategy for reducing the number of instantiations is based on decomposing a complex type into a set of orthogonal parameter dimensions (such as color space, channel depth, constness) and identifying which dimensions are important for a given operation.
    (...)
    We call this process type reduction.
    Type reduction is implemented with metafunctions which map a given data type and a particular algorithm to the class representative of that data type for the given algorithm.

    I think it, especially the section titles, makes the role of the reduce.hpp clearer now.

    Conclusion

    Since there is the "type reductions for GIL image types" are not used anywhere in the current GIL and there seem to be no one interested in picking it up to verify the technique for the modern compilers (newer than VS2005 (8.0) or GCC 4), I'm also voting to remove it completely (as @lpranam in #281 (comment)).

    If no objections arrive soon from @stefanseefeld, @chhenning or anyone else active/interested in GIL, then let's remove.

  6. mloskot commented on Mar 24, 2020

    @mloskot
    MemberAuthor

    Anyone fancy a PR removing the reduce.hpp?

  7. added a commit that references this issue on Mar 24, 2020
    2842286
  8. added a commit that references this issue on Mar 24, 2020
    6b9d00b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cat/enhancementImprovements, but not fixes addressing identified bugscat/refactoringAny nonfunctional changes

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions