amos 60319fadd5 Merge only Qwen-hard and -medium tasks: 11 from batches 25, 26 and 27
The user wants 2000 tasks, most of them ones Qwen cannot solve. New batch
tasks are now measured on their branch first (3 Qwen trials each), and only
HARD or MEDIUM tasks reach main; ROUTINE ones stay on the batch branches.
A session cut by context_limit or output_limit counts as a failure for
difficulty (user decision 2026-11-03); the trajectory stays incomplete.

- Batch 26 (route D, real upstream fixes in embedded open-source projects):
  7 HARD of 20 (coreJSON, littlefs, CANopen, coreMQTT, LwM2M, Zephyr ring,
  lwIP SNTP). Most failures are Qwen exhausting its context in the larger
  workspaces.
- Batch 25 (HWE mutation repairs): 1 HARD and 1 MEDIUM of 56.
- Batch 27 (spec-dense implementation tasks): 2 MEDIUM of the first 10.

Each task comes from the exact commit Qwen measured, and its digest matches
the measured one. Failure reasons are not yet reviewed, so difficulty is
the automatic label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:51:08 +08:00

77 lines
3.2 KiB
C

/* Observation-only driver: all inputs arrive on stdin, no expected values. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "lwm2m-tlv.h"
#include "lwm2m-object.h"
#include "lwm2m-tlv-reader.h"
#include "lwm2m-tlv-writer.h"
static size_t unhex(const char *s, uint8_t *p) {
size_t len=strlen(s)/2;
if(strcmp(s,"-")==0) return 0;
for(size_t i=0;i<len;i++) { unsigned x=0; sscanf(s+i*2,"%2x",&x); p[i]=(uint8_t)x; }
return len;
}
static void hex(const uint8_t *p, size_t n) {
if(!n) { printf("-"); return; }
for(size_t i=0;i<n;i++) printf("%02x",p[i]);
}
int main(void) {
char mode[8], token[2049];
int bits, ri, id;
int32_t input;
while(scanf("%7s",mode)==1) {
uint8_t data[1024]={0}, decoded[1024]={0};
lwm2m_buffer_t out={0,0,sizeof(data),data};
lwm2m_context_t ctx={0};
lwm2m_tlv_t tlv={0};
int32_t value=123456789;
size_t n=0, ret=0, parsed=0;
ctx.reader=&lwm2m_tlv_reader; ctx.writer=&lwm2m_tlv_writer;
ctx.outbuf=&out; ctx.last_value_len=99;
if(strcmp(mode,"D")==0) {
if(scanf("%d %2048s",&bits,token)!=2) return 2;
tlv.value=data; tlv.length=unhex(token,data);
ret=lwm2m_tlv_float32_to_fix(&tlv,&value,bits);
printf("D %zu %"PRId32"\n",ret,value);
} else if(strcmp(mode,"R")==0) {
if(scanf("%d %2048s",&bits,token)!=2) return 2;
n=unhex(token,data);
ret=lwm2m_object_read_float32fix(&ctx,data,n,&value,bits);
printf("R %zu %"PRId32" %u\n",ret,value,ctx.last_value_len);
} else if(strcmp(mode,"T")==0) {
if(scanf("%2048s",token)!=1) return 2;
n=unhex(token,data); ret=lwm2m_tlv_read(&tlv,data,n);
printf("T %zu",ret);
if(ret) { printf(" %u %u %lu %zu ",tlv.type,tlv.id,(unsigned long)tlv.length,lwm2m_tlv_get_size(&tlv)); hex(tlv.value,tlv.length); }
printf("\n");
} else if(strcmp(mode,"W")==0 || strcmp(mode,"I")==0 || strcmp(mode,"B")==0) {
if(scanf("%d %"SCNd32" %d %d",&bits,&input,&id,&ri)!=4) return 2;
ctx.resource_id=id; ctx.resource_instance_id=id;
if(ri) ctx.writer_flags=WRITER_RESOURCE_INSTANCE;
if(mode[0]=='W') n=lwm2m_object_write_float32fix(&ctx,input,bits);
if(mode[0]=='I') n=lwm2m_object_write_int(&ctx,input);
if(mode[0]=='B') n=lwm2m_object_write_boolean(&ctx,input);
if(mode[0]=='W') ret=lwm2m_object_read_float32fix(&ctx,data,out.len,&value,bits);
if(mode[0]=='I') ret=lwm2m_object_read_int(&ctx,data,out.len,&value);
if(mode[0]=='B') { int b=0; ret=lwm2m_object_read_boolean(&ctx,data,out.len,&b); value=b; }
parsed=lwm2m_tlv_read(&tlv,data,out.len);
printf("%s %zu ",mode,n); hex(data,n);
printf(" %zu %"PRId32" %u %zu %u %u\n",ret,value,ctx.last_value_len,parsed,tlv.type,tlv.id);
} else if(strcmp(mode,"S")==0) {
size_t capacity;
if(scanf("%d %zu %2048s",&id,&capacity,token)!=3) return 2;
size_t length=unhex(token,decoded);
ctx.resource_id=id;
n=lwm2m_object_write_string(&ctx,(char*)decoded,length);
memset(decoded,0xaa,sizeof(decoded));
ret=lwm2m_object_read_string(&ctx,data,out.len,decoded,capacity);
printf("S %zu ",n); hex(data,n);
printf(" %zu %u ",ret,ctx.last_value_len);
hex(decoded,ret?length+1:1); printf("\n");
} else return 2;
}
return 0;
}