[DFDL-WG] Possible DFDL spec errata

Steve Hanson smh at uk.ibm.com
Tue May 29 14:07:50 EDT 2012


"Only the first child (aka "first anything" in the structure) gets aligned 
and can have the conflict of its local alignment specification, and that 
of some enclosing structure. "

Yes that's what I was calling the first child rule.

In DFDL terms, would that also mean that the first child can not have any 
leading skip, as that would throw off the alignment?
We also need to bear in mind that we have complex element, sequence, first 
child element, all of which have alignment.

Regards

Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     Steve Hanson/UK/IBM at IBMGB
Cc:     dfdl-wg at ogf.org
Date:   29/05/2012 18:51
Subject:        Re: [DFDL-WG] Possible DFDL spec errata




I don't get it. Only the first child (aka "first anything" in the 
structure) gets aligned and can have the conflict of its local alignment 
specification, and that of some enclosing structure. 

If some later field gets aligned, then that's not relevant at all, as you 
treat that normally as another instance of alignment recursively (it 
could, afterall, also be a structure with sub fields having their own 
alignments, etc.)

Is that the "first child rule"

...mike

On Tue, May 29, 2012 at 1:45 PM, Steve Hanson <smh at uk.ibm.com> wrote:
Hi Mike 

The one rule that C does apply is the first child rule. C does not allow 
padding before the first child in a struct, so the alignment of the first 
child must not be greater than the alignment of the parent.  But it won't 
complain if the third element's alignment is greater than the parent's, 
for example.  So the rule needs to be relaxed, I think the only question 
is whether we drop the rule altogether or go with the first child rule. 

Regards

Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848 



From:        Mike Beckerle <mbeckerle.dfdl at gmail.com> 
To:        Steve Hanson/UK/IBM at IBMGB 
Cc:        dfdl-wg at ogf.org 
Date:        29/05/2012 18:08 
Subject:        Re: [DFDL-WG] Possible DFDL spec errata 






On Tue, May 29, 2012 at 12:03 PM, Steve Hanson <smh at uk.ibm.com> wrote: 
These were on the agenda for today's cancelled call. 

2. Is parent/child alignment rule too strict? 
 Spec property description for alignment says "The alignment of a child 
component must be less than 
 or equal the alignment of its parent element, sequence or choice". 
Experiments with creating DFDL schema 
 from C structures have shown that this rule is violated. It seems 
unnecessary.  Specifically, C ensures that the alignment 
 of objects in a repeating structure is preserved by rounding up the 
length of the structure, rather than aligning it. 

I think the point of this restriction was to insure that we didin't have 
conflicting alignments. Where the begining of the structure was aligned, 
say 64, but the first element was aligned at some incompatible boundary. 
Like 128. It would almost certainly be an error if the first element in a 
structure has a larger alignment constraint than the overall structure, 
and the user should pick where to place the constraint, and not constrain 
both, except when the constraints on one are implied by the constraints of 
another.

Example: I have a 4k page aligned structure. The first element is some 
type of double float coming from a global simple type def. The global 
simple type definition that says my specific kind of double floats are 
always 8-byte aligned. The 4k page is obviously 4096 byte aligned. There 
should be no conflict here. The page alignment "Wins" and the begining of 
the structure is 4k aligned, and that satisifies the 8-byte alignment of 
my specialized double float.

The point of having any restriction at all, is to catch conflicts. Eg., 
what if I had something that was 64-byte aligned, and I put it inside a 
structure that has only 2-byte alignment....., this is probably an error.

If this isn't going to catch any errors, then this restriction is 
unnecessary.
  

 3. Does DFDL need to support signed integer types with lengthUnits 
'bits'? 
 Spec only allows unsigned integers to have lengthUnits 'bits', but it is 
possible in C structures to delare 
 bit fields for signed integers. They behave like two's complement. It 
looks like the spec is being 
 too restrictive in its types for 'bits'. 

I missed this over restriction. Signed are definitely needed.

  
-- 
Mike Beckerle | OGF DFDL WG Co-Chair 
Tel:  781-330-0412


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



-- 
Mike Beckerle | OGF DFDL WG Co-Chair 
Tel:  781-330-0412


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20120529/3988150a/attachment.html>


More information about the dfdl-wg mailing list