[GHC] #13508: Clarify Some Restrictions on Compact Regions
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: new Priority: lowest | Milestone: Component: | Version: 8.1 libraries/compact | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I've been reading over the docs for using compact regions here: [https ://phabricator-files.haskell.org/file/data/uqmgx4accjldseyd34xj/PHID-FILE- 3sihhhdhl4gaeszvphzb/Compact.hs]. I'm pretty excited about this feature, but there's one thing that the docs don't make totally clear. Can MutableByteArray# be placed in a compact region? Near the top, the docs specifically say that "object[s] with mutable pointer fields" cannot be compacted, but that doesn't rule out `MutableByteArray#`. Later down, in the docs for `compact`, this restriction is broadened to any mutable data. I would like to see the docs clarify this better. The existence of `resizeMutableByteArray#` makes me think that it should not possible, but I'd like to be sure. Thanks. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: patch Priority: lowest | Milestone: 8.2.1 Component: | Version: 8.1 libraries/compact | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3407 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D3407 * milestone: => 8.2.1 Comment: I believe mutable byte arrays should be fine. The limitation is merely that you can't have things with **mutable pointers**. This limitation is due to the principle invariant of a compact region: that all objects in the transitive closure of an given member must also be members of the region. This invariant is enforced when the region is constructed. Allowing mutable pointers (e.g. `MutableArray#` and `MutVar#`) would enable the user to break this invariant by introducing a pointer to an object residing outside of the region. I agree that the language in the documentation could be improved. How does Phab:D2407 look? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: patch Priority: lowest | Milestone: 8.2.1 Component: | Version: 8.1 libraries/compact | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3407 Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): We should seriously think about how to set up a "can be compacted" type class, either by hand in the 'compact' package, or with special solver support. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: patch Priority: lowest | Milestone: 8.2.1 Component: | Version: 8.1 libraries/compact | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3407 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"38f9eadd8e4746c2fabf83045073134f5a554a06/ghc" 38f9ead/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="38f9eadd8e4746c2fabf83045073134f5a554a06" compact: Clarify mutability restriction Fixes #13508. [skip ci] Test Plan: Read it Reviewers: austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3407 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: closed Priority: lowest | Milestone: 8.2.1 Component: | Version: 8.1 libraries/compact | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3407 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13508: Clarify Some Restrictions on Compact Regions -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: ezyang Type: bug | Status: closed Priority: lowest | Milestone: 8.2.1 Component: | Version: 8.1 libraries/compact | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3407 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Merged to `ghc-8.2` as well. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13508#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC